Details
-
Improvement
-
Resolution: Duplicate
-
Neutral
-
None
-
4.5.4
-
None
Description
this can already be achieved by using custom Store executor, like e.g.
package info.magnolia.module.cache.executor; import info.magnolia.module.cache.filter.CacheResponseWrapper; import info.magnolia.module.cache.filter.CachedEntry; import info.magnolia.module.cache.filter.CachedError; import java.io.IOException; import javax.servlet.http.HttpServletRequest; public class DoNotStoreErrorsStore extends Store { @Override protected CachedEntry makeCachedEntry(HttpServletRequest request, CacheResponseWrapper cachedResponse) throws IOException { CachedEntry entry = super.makeCachedEntry(request, cachedResponse); if (entry instanceof CachedError) { CachedError error = ((CachedError) entry); // override the entry with time to live set to 0 entry = new CachedError(error.getStatusCode(), error.getOriginalURL(), 0); } return entry; } }
but it should be in by default and configurable (disable caching for different kind of errors, cache different errors (based on status code) for different time intervals).
Checklists
Acceptance criteria
Attachments
Issue Links
- duplicates
-
MGNLCACHE-50 Provide possibility to exclude errors from being cached
-
- Closed
-