Another useful Apache utility called mod_headers can be used to set an expiration date in the future of files like images and static html pages. This means that rather than loading image files or unchanging html code every time you visit a site, a check will be made in the cache of your browser to see if there is already an existing copy of the file requested. If the file is still ‘fresh’ – ie within the period specified by the expiration, the cached version of the file will be used and no ‘refresh’ call will be made to the host server.
Your server needs to have mod_headers enabled before being able to use these directives. You can add this code to your root htaccess file, or http.conf / vhosts.conf if you have access to those.
When changing conf files on an Apache server, remember to Apply Changes and restart the Apache server for the directives to take effect.
Another approach is to use ExpiresByType commands in the htaccess file:
Final tip: set eTags to null using:
Header unset ETag FileETag None