Can't disable cache on subdomain (staging) (SiteGround)

Hello, need to disable cache for a subdomain (staging2.???.com) with a WordPress installation and hosted on SiteGround, but so far the staging2.???.com URL is still returning a cached version. Other assets or sub-paths on that domain are bypassing the cache, but not the homepage HTML returned by WordPress, that still goes to a cache HIT.

I have so far tried without success:

  • Enabling the Development Mode for the ???.com domain
  • Purging cache for the ???.com domain
  • Adding a Page Rule for staging2.???.com/* and setting the Cache Level at Bypass

None of those actions seem to lead to have the request to the root staging2.???.com page return with the header “cache-control: no-cache, must-revalidate, max-age=0” and without header “x-proxy-cache: HIT”.

Any advice?

This should do it. Can you post a picture of the actual Page Rule? Make sure you include the subdomain name so we can test it.

Thank you @sdayman. Sure, here goes the screenshot:

That’s working. Images are also showing as DYNAMIC.

But I’m getting 404s for some JS files:

Ok, but somehow the HTML that comes from that request (that’s being processed by PHP/WordPress on the server) it’s an old version—the newer version has that JS hash updated. (I mean, might be another server level cache that’s making the issue, but let me take a few questions to help me with this while we’re here.)

So, from Cloudflare, this page/HTML isn’t being served from the cache, yes? How can I see on the headers that a particular page isn’t being served from the Cloudflare cache?

Sending in a screenshot of the response headers, I see the header x-proxy-cache: HIT, so this isn’t related to Cloudflare? Perhaps it’s the NGINX proxy or dynamic cache of SiteGround, which means that on Cloudflare it’s all good (it’s bypassing cache) but somehow serving some cache on SiteGround side, could that be it?

Anyway @sdayman, any help you could give me into reading/debuging this, I’m appreciated.

And thank you for your help and kindness already.

I did notice what looks like some sort of server caching (not on Cloudflare). By the way, you shouldn’t have to Bypass cache with your setup. By default, Cloudflare doesn’t cache HTML, so if you use your Page Rule, that will disable caching for images, CSS, and JS. Though at this point, you may want to leave it in BYPASS while you debug this.

Ok, thank you @sdayman. I don’t understand, I disabled all the caching (NGINX Direct Delivery and SiteGround Dynamic Caching [1][2]) and somehow it’s still serving an outdated version.

At this point, I feel it might be the Dynamic Caching of SiteGround, I’ll take a look into what they have as documentation/info and see if/how can I best flush or invalidate their cache.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.