I recently hosted a VPS website that supports Apache2, and worked on recommendations for improving performance from YSlow. Among these improvements, mod_deflate and mod_expires were used, and since I have root access, I can directly edit Apache configuration files.
mod_deflate now works, but I'm having problems with mod_expires, here is what I did:
enable expiration module and restart the server
a2enmod expires
service apache2 restart
create a new file "expires.conf" in the mods_enabled folder, which contains the following:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
However, when checking in different Dev Tools browsers in the Network section, the files show Cache Control of None.
mod_expires script .htaccess, :/var/www/sitename/public_html, .htaccess , apache .
htaccess apache2.conf.
, htaccess , ( IfModule). 500. htaccess.
, dev - -, .
- ?
!