Output Caching JSON/HTML/


Is it possible to cache a certain JSON/HTML response? And invalidate it based on some condition (say some func() bool)?


Currently I am playing around this idea employing Context#Response#Before(func()) and Context#Response#After(func()) methods and some code to handle the caching.

This approach might work because the payload must be known before hand and caching can only be applied for fixed size data.

Good to know echo has those methods.