-
如何判断你的网站页面是否已经缓存
如果你的网站启用了缓存工具,那如何判断这个缓存工具是否正常运转呢?下面这个网站可以可以帮我们来检测我们的网站页面是否已经正确缓存。 Caching can speed up your site and extensively lower the load on your server. If you are using a Content Delivery network (CDN), Varnish or another caching mechanism, the fastest method is to check the http headers. Although headers may be modified for reasons like security, they usually expose if your caching system is working or not. A quick way of to test if your caching is enabled and working correctly on your website is by using the Cache Checker tool: https://cache-checker.com If you use the Cache Checker tool, you will also receive the cache header response. The most common caching header that you will encounter is the X-cache header. It is used by Content Delivery Networks, Varnish, Fastcgi cache, … and it will have a status HIT or MISS. So if the status is HIT, the page has been served from cache. There are different ways to fetch the headers of your current request. You can use the inspect elements tool that is in your browsers development tools. Below we list the most important headers that are related to caching. Cache-control Resources can define their own caching policy with the cache-control header. It has a number of instructions (or directives) that determine how…