What Are Expires Headers?
Expires Headers tells the browser how long they should store a file for in the cache. Should the browser grab a file from the cache or request it from the server? The idea of expires headers is to reduce the load time of downloads from the server and reduce the number of HTTP requests for the server. This helps with speed and performance of the page and lowers bandwidth use. When a visitor lands on your landing page, their browser must communicate with the server to download all the required files that they need to navigate your page properly. The more content and media that is added,the more time is needed for files to be transferred over.
Nowadays, websites might need 50+ files per page to transfer. These files can be small or large depending on how optimized your page is. However, it is important to not disregard small files as they can start to build up.
How Do Expires Headers Work?
Expires Headers on specific files and file types are under your control. When a visitor comes to the website, Expires Headers will check when the file was last downloaded, and if it was recent then it will display them from the cache. However, if it wasn’t then it will download the newest version from the server. Items that don’t change frequently or at all such as your logo can have late expiry times. But for items that change regularly, it is recommended to set short expiry times.
The skeleton of your Expires Headers should look something like this:
<IfModule mod_expires.c> # Enable expirations ExpiresActive On # Default directive ExpiresDefault "access plus 1 month" </IfModule>
An example of Expires Headers in your file looks similar to this:
Speak with an optimization specialist about this strategy. Expired headers fit into an overall optimization and caching strategies. Connect with a Specialist at Digital Shift to have your questions answered. Be certain to follow us on social media and to check out our other digital marketing terms and exmaples!