• I have just added a couple of URL’s into the section “Prevent the following URIs to be cached:

    /poll*
    /category/polls*

    Ideally I would like all posts in the category “polls” to be prevented from caching. If this is not possible then the other option is for all posts with /poll* in the URL to be prevented from caching. My questions are as follows:

    1) Exclude Category from caching – Is there a way to exclude all posts in a category from caching?

    2) Clearing cache from excluded posts – Is there a way to clear the cache for excluded posts without doing this manually for each post (there are over 1,000 posts in the category “polls”) and without clearing the whole Cloudflare cache?

    Thanks in advance for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter supertrooper2

    (@supertrooper2)

    Does the following code work with wild cards?

    do_action(“swcfpc_purge_cache”, array(“https://example.com/some-page/”));

    Please advise.

    Plugin Contributor iSaumya

    (@isaumya)

    1) Exclude Category from caching – Is there a way to exclude all posts in a category from caching?

    – unfortunately no. You can bypass pages based on URL paths like you have shown above.

    Clearing cache from excluded posts – Is there a way to clear the cache for excluded posts without doing this manually for each post (there are over 1,000 posts in the category “polls”) and without clearing the whole Cloudflare cache?

    – The best option would be to purge the whole cache once after you have made the changes and then wait for the cache to propagate which doesn’t take much time.

    Does the following code work with wild cards?

    do_action(“swcfpc_purge_cache”, array(“https://example.com/some-page/”));

    – Yes you can try that as mentioned inside the Advanced FAQ section of the plugin but if you have too many URLs or if you exceed the Cloudflare API call limit (122req/5min) then you may face problems.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to prevent caching for a specific category?’ is closed to new replies.