Caching static files on the client not only improves the server response speed, but also reduces bandwidth and server load. Use apachemod_expire
Caching static files on the client not only improves the server response speed, but also reduces bandwidth and server load.
Apache mod_expires can be used to Cache static files. this mod_expires function mainly adds the max-age value of the Cache-Control header to the response header, which is used to set the Cache expiration time.
Setting method:
1. in the apache configuration file httpd. conf, find
# LoadModule expires_module modules/mod_expires.so remove #
2. Add configuration information:
ExpiresActive on # cache for ten days
ExpiresBytype text/css "access plus 10 days
ExpiresByType application/x-javascript "access plus 10 days"
ExpiresByType image/jpeg "access plus 10 days"
Expiresbytype image/gif "access plus 10 days"
3. restart apache.