0

I'm trying to force Apache to cache 404, 410 and 301 responses. I've found this solution (which does exactly the opposite and many other example to avoid caching).

<IfModule mod_headers.c>
 Header always unset ETag "expr=%{REQUEST_STATUS} == 404"
 Header always set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" "expr=%{REQUEST_STATUS} == 404"
 Header always set Pragma "no-cache" "expr=%{REQUEST_STATUS} == 404"
 Header always set Expires "Wed, 11 Jan 1984 05:00:00 GMT" "expr=%{REQUEST_STATUS} == 404"
</IfModule>

These are the response headers from my server, I must delete them and tell the browser to cache the pages.

cache-control: no-cache, must-revalidate, max-age=0
expires: Wed, 11 Jan 1984 05:00:00 GMT

How should I change the code to cache error and redirects?

Revious
  • 187
  • 1
  • 12

0 Answers0