• Resolved joejamin

    (@joejamin)


    I’m wanting to cache the base URL (www.example.com/page/) and serve that to people who visit (www.example.com/page/?s=1) as well. Is this possible? Don’t see how that’s achieved with the exclusions setting. Any ideas? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @joejamin

    I hope you are doing well

    Hummingbird will ignore the Query String by default, so any string will not be cached, if you would like to cache it in the future you can enable the Caching > “Cache URL queries”

    More information on:

    https://wpmudev.com/docs/wpmu-dev-plugins/hummingbird/#caching

    Best Regards
    Patrick Freitas

    Thread Starter joejamin

    (@joejamin)

    Hi Patrick – What I’m trying to achieve is to actually ignore the string and serve the base URL. Does that make sense? They visit “/page/?s=1” and they get the cached page for “/page/” rather than needing the URL with the unique parameter cached individually each time.

    Thank you!

    Hello @joejamin !

    Hope you’re having a good day!

    This is unfortunately not possible due to the fact that those URLs are actually different ones when it comes to how HTTP requests are handled. I don’t think there’s any caching plugin that would support this scenario because of this.

    As Patrick mentioned, URLs with query parameters aren’t cached by default because they are considered to have dynamic content which is accessed using the query parameter. Hummingbird does support caching those as well, but still /page/ and /page/?s=1 are two different URLs.

    I don’t think that it would be possible to workaround that by defining redirects on the server’s side as well.

    The only possibility in this case that comes to my mind is to use anchors instead as /page/ and /page/#s1 will in fact be the same thing (anchors are browser-side), but you can still read the anchor and have dynamic content by using JS code and Ajax requests.

    Kind regards,
    Pawel

    Thread Starter joejamin

    (@joejamin)

    Thanks for the replies! With Cloudflare APO for example it ignores utm parameters in the url and caches base url. Also Nginx server level caching often does this as well I’ve seen. Will have to try another solution. Appreciate the help ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ignore url string – cache base url’ is closed to new replies.