coderedcorp/wagtail-cache

Is there a way of stopping 302/301 and 404s being cached?

Closed this issue · 1 comments

Is there a way of stopping 302/301 and 404s being cached? automatically

Yes, use the is_response_cacheable hook. Check request.status and return False. https://docs.coderedcorp.com/wagtail-cache/getting_started/hooks.html

Side note, I'd highly recommend caching 404s as those are very frequent (e.g. bots probing for WordPress URLs) and they are taxing on the database.