Support » Plugin: Ads.txt Manager » Cache-bust Issue

  • Hi there!

    This plugin works great. Just one small request:

    Some crawlers of ads.txt will cache-bust to ensure the latest file is requested (e.g. However, your plugin always returns a 404 when any query string is added.

    Perhaps the following change in ads-txt.php would fix things:

    $request = esc_url_raw( $_SERVER['REQUEST_URI'] );

    $request = esc_url_raw(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

    -EmbedPlus Team

    • This topic was modified 2 years, 10 months ago by embedplus.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Helen Hou-Sandi


    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    Hi @embedplus! Thanks for the report. I’ve created a GitHub issue for tracking here:

    Do you have any info on specific crawlers that do this? I’m not against fixing this at all, I would just like better understanding of why they do this and if they fall back to the non-query string URL at all.

    Thread Starter embedplus


    Hi Helen,

    Thanks for the reply! Imagine though, what happens after somebody updates ads.txt. You’re right, any requester would/should recheck without the query string as a fallback. But the issue is not necessarily the 404. It’s the risk that the fallback mechanism (i.e. no query string) for any requester could retrieve a stale/incorrect version of ads.txt.

    That risk is higher with aggressive caching plugins or if someone fronts their site with Cloudflare or Cache etc., which is fairly common these days. In either case, the request might never hit your plugin’s function again until the cached version somehow eventually expires on its own. The query string simply ensures ads.txt requests can reach your plugin’s latest output in all these situations.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cache-bust Issue’ is closed to new replies.