I have this in my htaccess file:
<IfModule mod_expires.c>
<FilesMatch "\.(gif|png|jpg|jpeg|svg|webp|css|swf|ico|eot|woff|js)$">
ExpiresActive On
ExpiresDefault "access plus 1 year"
</FilesMatch>
</IfModule>
Header set Cache-Control "max-age=31536000, public"
I have this in my php file:
if(session_id()=='') session_start();
session_write_close();
header('Cache-Control:max-age=2592000');
And yet, when I test the page on cache-checker.com, I get this response:
Server: Apache
X-Powered-By: PHP/7.4.33
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-Frame-Options: DENY
Set-Cookie: PHPSESSID=5f662c687f5b5e3459a01c0a896ec11f; path=/
Referrer-Policy: strict-origin-when-cross-origin
Upgrade: h2
Connection: keep-alive
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=631138519; includeSubDomains
X-XSS-Protection: 1; mode=block
Content-Type: text/html; charset=utf-8
I am trying to enable browser caching.
Any help would be appreciated.
curl -v -I https://example..com. Then you should check your complete webserver chain. Maybe a caching module is enabled.Expires: Thu, 19 Nov 1981 08:52:00 GMTmeans you aren't even telling 😀