Cache: Test caching rules

How to test your caching rules and prevent fatal errors on your WordPress website.

Jan Hornung avatar
Written by Jan Hornung
Updated over a week ago

Custom caching rules and exceptions are very powerful. They can overwrite nearly every other caching rule on your website, regardless of whether the existing rules come from plugins like WooCommerce or our server settings.

Important: When you set up a new rule for the cache, it can up to ten minutes for the system to implement it. Make sure you wait ten minutes before testing any new caching rules.



Response header as a source of information

To test caching rules, you need to look at the so-called response headers on your site. These headers contain all the information required to check whether the caching rules on your site are working. The Mozilla Foundation explains exactly what HTTP response headers are and how they are structured in the following article: HTTP headers.

If you're not sure how to interpret the HTTP response headers, please ask your IT support or web designer for assistance.

Three ways to check your site's response headers

There are a number of ways to test your website's response headers. We have found the three methods below to be particularly effective:

1) Browser console (suitable for all users)

Every modern browser has a built-in developer console that can be used to access all kinds of advanced information about a web page. The developer console also allows you to take a close look at the response headers of your site.

Please note: The steps described below are from Chrome but are almost identical in Safari and Firefox.

Open the developer console: Open your web browser and go to the URL you want to test, i.e. the URL or site you defined the caching rule for. Next, right-click in your browser window and select Inspect.

Choose Network view: The developer console will open. Select the Network tab and reload the site.

Look at the response header of the first request: When you reload the site, every single request is displayed in the network view. Click on the relevant request (usually the first one) and take a look at the response header. This can be found under the Headers tab in the Response headers section. The caching information is located at the bottom of the header details. If the information matches the rule you created, the rule has been defined properly. If the information does not match, you need to check the rule again.

2) curl -I (for advanced users)

If you regularly work with SSH on your site and know how to communicate with your site via the console, you can use curl -I option on the URL you want to check. The -I option will return all the header information the curl produces.

Caching Rules - Terminal check

3) Dev tools (for advanced users)

Of course, you can also use any other kind of tool that can send requests to your site. Tools like Postman and REST test test can be helpful, especially if you want to set up complex caching rules.

Did this answer your question?