Hello @stevenmaas
Thank you for reaching out and I am happy to help!
The Cache is primed according to the sitemap you add to the Sitmap URL: field. There is no option to exclude specific pages from priming, and also allowing them to be cached. Meaning , the option would be to add the DONTCACHEPAGE constant to those pages which would bypass priming and caching.
You can however, use custom sitemap. Meaning, create the sitemap which would not contain those pages/posts and add that sitemap URL to the Cache priming.
This will allow W3TC to preload the cache for all the pages in the sitemap, and other pages witll be cached when visited and not with priming.
Let me know if this helps!
Thanks!
Thank you for your prompt reply.
Since sitemaps are dynamic, that is, if I add a 1 page then I would have to update the cache sitemap each time. I am using your command wp w3-total-cache pgcache_prime –limit=50. Is there a way to specify the –sitemap=\my-sitemap.xml? If not, please consider adding an option to prime a specific sitemap(s).
Another option would be to exclude from priming if a string exists in the sitemap url. In the command you could add,for example: –exclude=posts. This would exclude the sitemap that contains posts. You could even add includes option –include=pages.
This would be a huge benefit because I could prime the less frequent posts at 1 am and prime other posts that are more frequently updated several times a day.
You could add this on the front end as well like you do with pages.
Never cache pages that use these custom fields:
you could then add a filed like the below to exclude from priming..
Never prime pages that contain value:
Hello @stevenmaas
Thank you for your feedback.
I’ll have to bring this to the team and check with them on the availability of such option and exclusions
Thanks!
Two Exclude Options would be great…
–exclude-sitemap=abc-pages.xml, abc-category-1.xml
–exclude-posts=cpt-slug-1, cpt-slug-2, key-word-1, category-1
Option to run only 1 site map (for posts that need frequent updating)
–sitemap=my-frequent-pages.xml
Option for posts modified last x days
–days=60
Option to include only posts
–include-posts=city-1, city-2, city-3
Right now I have a plugin which added 300 pages to my sitemap without a modification date. I need them for SEO but not cached. Without a modification date this means every time I run the prime cache they are cached and there is no way for me to exclude. Several times a day I have to cycle through the 300 posts to get back to the pages I really need cached. If I could provide a few key words to exclude the posts then I could exclude from the Prime but leave for SEO.
Imagine you have a real estate website with 10,000 properties. I would now want to cache every one several times a day unless my site is really busy. I would like to cache pages in cities for example that are in my area:
–sitemap=properties.xml –include-posts=city-1, city-2, city-3
Please try to add these options.
Thanks again for your amazing plugin!
Hello @stevenmaas
Thank you for your feedback.
It sounds like a nice idea. Once again, I will bring this to the dev team and we’ll have a talk about the availability of such implementation.
Please note that it’s a holiday season and it may take a week or two! You can always open a ticket in our GitHub repository as a feature request, and add those details there so the dev team can review this.
You are most welcome!
We would really appreciate it if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users.
Thanks!