2

I have a blog were most of the traffic comes with query strings for tracking purposes, which means that query strings doesn't change the content of the site.

As I recently learned - W3 Total Cache & WP Fastest Cache, both don't cache pages with query strings.

The question is - how to make it W3 cache or WP cache cache pages with query string & most importantly make the query strings "ignorable", which means for example: if we have two hits: www.example.com/?t=123 www.example.com/?t=333

both are served as one page from the same cache.

I know that I can add "accepted query strings", but I don't know if it just allows to cache pages with query strings, or it also makes query string ignorable? Also - I think this feature forces pages with query strings to work with disk cache instead of disk: enhanced, which I'd like not to do. So - is there is a solution (it can be with W3 total or WP fastest) that ignores query strings and allow pages with them to get cached - without giving up disk:enhanced?

1 Answer 1

2

W3TC "Accepted query strings:" makes listed query strings ignorable: https://github.com/szepeviktor/w3-total-cache-fixed/pull/380

My current list is:

utm_source
utm_medium
gclid

This way these pages:

/page
/page?utm_source=blabla&utm_medium=email
/page?glcid=y349untg93h45t

are served from page enhanced cache as for /page

10
  • I think this is accepted solution. But if i add parameter "s" (search query) and search something, it returns the homepage. Does it work like that for you too? May 2, 2019 at 10:02
  • @MichaelRogers That's right. If you add "s" to the ignorable list then it's just ignored and you get the homepage. I think you do not have to add "s" to the list if you want your search works all right. As you can see I don't have "s" on my list. May 3, 2019 at 12:15
  • I realize i didn't want to ignore them. I needed them to be cached. But the option to cache queried string is greyed out. I read it's because i use "disk: enhanced"... May 3, 2019 at 14:01
  • I have "Cache URIs with query string variables" enabled with "Page Cache Method" = "Opcode: Alternative PHP Cache (APC / APCu)" May 4, 2019 at 20:42
  • Hm. I need that then. But that option is also greyed out. May 8, 2019 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.