![]() If you’re using WP Rocket, WP Rocket will automatically implement both page caching and browser caching for you – more on this later. Note – browser caching is a separate strategy from page caching, which is what most people are talking about when they reference “caching” for WordPress. By setting an expiration date, you’re ensuring that visitors will periodically re-download the relevant resources to ensure an updated experience.įor more, check out our full explanation post on browser caching. Why add expiration dates at all? Because you want to make sure your visitors still get the most recent version of your page. “Hey, store JPEG files for one year, but only store PNG files for one month”.īasically, you set up expiration dates for how long visitors’ browsers should store certain content. In order to enable browser caching, you need to configure your web server so that it tells visitors’ browsers which types of files to store and how long to store them for before re-downloading them.įor example, you can configure your server to say: This is why you typically see “Leverage browser caching” as a common recommendation in tools like GTmetrix and Pingdom. Then, a visitor’s browser can load that resource locally rather than re-downloading it, which will speed up your site’s load times and create a better experience for your visitors. Forcing a visitor’s browser to re-download your logo for every single page load is just a waste of resources that will slow down your site.īrowser caching lets you avoid that scenario by saving certain types of resources on a visitor’s local computer. However, on subsequent visits, it doesn’t make sense to force them to request and download every single resource on each visit.įor example, your logo probably loads on every single page, but it doesn’t change that often. When someone visits your website for the first time, their web browser needs to request and download every single file to render your page. How cache-control applies to WordPress/WP Rocket users.What cache-control is and how it works (HTTP headers).But before we get into the cache-control header, we first need to explain the concept of browser caching. In this article, we’ll explain what cache-control is and how it affects behavior on your website. That sounds a little complicated – we know! So if you bear with us, we’ll dig into the topic of cache-control in much greater detail. In a nutshell, cache-control is an HTTP header that specifies browser caching policies for certain static resources on your website, such as your images. Confused by what the cache-control HTTP header is and how it works with your WordPress site?
0 Comments
Leave a Reply. |