• Recently I’ve been having issues on my site where I’ll update a post and my site will timeout and throw a 500 error. After much experimentation, it turns out that clearing my cache appears to fix the issue, at least until the cache fills back up.

    My website has 268 posts and 4 pages, but a LOT of comments. I’ve disabled caching of all non-posts and pages. And yet somehow my wp-cache is generating over 20,000 cached files (none of them marked as expired), which appears to be impacting my site’s performance.

    I’d expect to have closer to 272 cached files, not 20,000.

    Clearing my cache and looking at the file list, I’m seeing lots of stuff like this:

    https://www.siteurl.com/page-name/?replytocom=251961. So I’m presuming that bots are following ALL of the comment response links, and wp-cache is treating those as separate page requests to cache.

    Is there any way to tell wp-cache to ignore replytocom URL parameters? Ideas for other solutions?

    https://www.ads-software.com/plugins/wp-super-cache/

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

    (@tarindel)

    Update for anyone else who finds this: https://www.ads-software.com/plugins/replytocom-controller/ removes the ?replytocom parameter.

    It means people who aren’t running JS won’t be able to reply, but imo that’s a fair trade for not having my cache file blown out every day.

    You have to know how you want your site to act when it is asked to return url?querystring.
    Do you want to return exactly this page? Do you want it cached? Do you want to always renter page if it has querystring? Or maybe you are fine with “return page as if querystring wasn’t there”? (be aware it will break features like search by default)

    When you know what you want, it’s easy to know what needs to be done. In your case, some of solutions would be disable cache for pages with querystring, or writing htaccess file in a way that would ignore replytocom querystring.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I prevent caching of pages with url parameters?’ is closed to new replies.