According to Apache HTTP server 2.2 Module mod_expires, you can add file expiration to httpd configuration.
[root@localhost ~]# vi /etc/httpd/conf/httpd.confPlease note that:
ExpiresDefault "access plus 1 second"
ExpiresByType application/x-icon "access plus 1 year"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/html "access plus 10 minutes"
- Time units can be singular or plural, it depends on your cardinal numbers. For example:
1 second -> 10 seconds
1 minute -> 30 minutes
1 week -> 4 weeks
Internet media type
Deflating files before responding to your clients can also be helpful to the server performance, you may refer to my post as following:
How to Enable Deflation of Files on Apache Web Server