Enabling client-side browsers to cache the web pages can speed up the response time of your visitors.
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.conf
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"
Please note that:
- 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
For applying more MIME types in your web server, you may refer to this page: 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.