• Resolved junx0r

    (@junx0r)


    Hello, I have the option to cache URIs with query string variables checked because I need to cache URLs like https://www.example.com/hello-world/?utm_source=email

    The issue I’m having is that the search on the site look like example.com/?s=query and those search pages get cached too, it’s causing bogus pages to be cached due to spam queries.

    Is it possible to specify ?s= in the excluded pages section? How exactly do I enter it, is it /\?s=

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @junx0r

    Thank you for reaching out and I am happy to assist you with this.

    Please go to Performance>Page Cache>Advanced>Never Cache following pages field and add /?s=

    Make sure to save all settings and purge the cache. When you check any search results that start with /?s= you can see in the W3TC HTML snippet (check the source of the page at the bottom):

    Page Caching using disk (Requested URI is rejected)

    This means that this page is not cached as a result of the exception added to Never Cache following pages

    Let me know if this helps!

    Thanks!

    Thread Starter junx0r

    (@junx0r)

    Hello, I followed your instructions but it still caches the page. I get

    Object Caching 364/586 objects using redis
    Page Caching using redis (Requested method is POST)
    Minified using redis

    Any thoughts on why this is happening? Does it need regex format?

    Thank you.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @junx0r

    Thank you for your feedback.

    As you can see Page Caching using disk: enhanced (Requested method is POST). This page is not cached as W3 Total Cache is not caching POST requests

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to cache URIs with query string but exclude search results?’ is closed to new replies.