SiteMap Exclude Cache – How to Use LiteSpeed ​​Cache

How to Exclude Cache to Fix Sitemap 404 Error

Sitemaps are generated by SEO plugins, so if set up correctly, there shouldn’t be any major issues. However, I’ve recently noticed that in Rank Math’s 404 logs, the sitemap is not accessible.

Sitemap is important, so I checked Google console and SEO plugin, but there was no problem with the settings. So I suspected the cache plugin that I recently replaced, and after clearing all caches, it worked properly.

This can be considered a temporary phenomenon, but if it happens continuously, it can cause fatal problems for SEO. Therefore, we have reviewed various articles on this subject.

After checking various articles, I saw opinions that caching Sitemap is not good because it slows down the updates for new articles. So I decided to set the LiteSpeed ​​Cache settings to not cache Sitemap.

So, let’s see how to clear the Sitemap cache from LiteSpeed ​​Cache.

Pros and Cons of Not Caching

First, let’s look at the pros and cons of caching and not caching the sitemap.

  • Benefits of Caching: If search engine crawlers frequently request your sitemap, using cache can reduce the load on your server.
  • Disadvantages of caching: Content updates may be delayed because they are not reflected in real time due to caching, which may affect SEO. Also, if the sitemap is updated frequently, it may be difficult to set a cache expiration time.

Check sitemap address

I know the sitemap address, but there are different sitemap addresses depending on the SEO plugin, so it’s a good idea to check all of them and make sure they are not cached anymore.

Exclude

In the case of plugins like Rank Math , if you go into the sitemap, there are HTML sitemaps, posts, pages, attachments, categories, and tags, and if they are all exposed to search engines, you should organize the sitemap URLs so that they are not all cached.

To summarize, since there can be multiple Sitemap addresses, all of those addresses must be registered for cache exclusion.

Sitemap cache exclusion settings

Exclude

If you are using a cache plugin, you can easily exclude it from the cache. In the case of the LiteSpeed ​​Cache plugin, go to the cache settings and select Exclude at the top.

Then you will see a place called Do not cache URLs, and here you can add the list of sitemap addresses that I explained above. Then click on the Save Changes button and it will no longer be cached.

How to check cache exclusion

Exclude

If you have excluded your sitemap from the cache with the LiteSpeed ​​Cache plugin, you will need to check if the settings are still working. The easiest way to do this is to go to your sitemap in your browser and check it in the developer tools.

  • Open sitemap in browser
  • Press F12 to enter developer tools
  • Select Network at the top and select your sitemap from the list (if you don’t see it, refresh your browser)
  • Check Cache-Control in Headers information. If it is no-cache, the settings are correct.

Basically, if you don’t exclude it, the cache plugin will cache the sitemap as well. If you’re getting a 404 error like me, try excluding it by referring to the explanation above.

▶ How to completely remove Varnish Cache from Ubuntu

▶ How to install Redis server on OpenliteSpeed ​​web server

▶ How to install the OpenLiteSpeed ​​(OLS) web server on Lightsail

Leave a Comment

Your email address will not be published. Required fields are marked *