I'm using the code below in my .htaccess file to enable caching for my website:## EXPIRES CACHING ##<IfModule mod_expires.c>ExpiresActive OnExpiresByType image/jpg access 1 yearExpiresByType image/jpeg access 1 yearExpiresByType image/gif access 1 yearExpiresByType image/png access 1 yearExpiresByType text/css access 1 monthExpiresByType application/pdf access 1 monthExpiresByType text/x-javascript access 1 monthExpiresByType application/x-shockwave-flash access 1 monthExpiresByType image/x-icon access 1 yearExpiresDefault access 1 month</IfModule>## EXPIRES CACHING ##In that code, you can see that the cache expiration time is set as 1 year for some file types and 1 month for others. What I need is to make it expire after a single day. I have already tried to replace it by 1 day and 24 hours, but neither of those work.
How to set browser cache to expire after one day?
apache;cache control
It might be as simple as missing one keyword that is causing your issue.## EXPIRES CACHING ##<IfModule mod_expires.c>ExpiresActive OnExpiresByType image/jpg access plus 1 dayExpiresByType image/jpeg access plus 1 dayExpiresByType image/gif access plus 1 dayExpiresByType image/png access plus 1 dayExpiresByType text/css access plus 1 dayExpiresByType application/pdf access plus 1 dayExpiresByType text/x-javascript access plus 1 dayExpiresByType application/x-shockwave-flash access plus 1 dayExpiresByType image/x-icon access plus 1 dayExpiresDefault access plus 1 day</IfModule>## EXPIRES CACHING ##