-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pages with querystrings are not automatically purged when their caching enabled #34
Comments
In fact, now that I think about it, it's not just What should ideally happen is anything matching https://example.com/post* would get its cache cleared, which would include any variations of the url - otherwise they'll all get stale cache. |
Purging arbitrary query strings when "Cache with querystrings" enabled can't be supported by plugin. Small amount of alternatives may be handled by hooks, but for general coverage you may use services like Varnish for that functionality. |
So what's the solution to at least support ?amp purging @maxicus? AMP is getting more and more popular, and right now W3TC straight up breaks cache busting for AMP sites. Please re-open the ticket, or if you have a solution, please provide it here. I'm sure I won't be the last person to run into this issue. |
Technically ideal case for amp pages is to use If you require to have For more complex set ups when unknown and potentially large number of page variations with query strings should be purged you should add Varnish server to your stack and W3TC will send mask-based purge requests there. |
Actually, Also, For now, to work with purging just the In the future, if we ever make it there and transition the whole site to AMP-first, we won't have |
For example when post is updated - category pages, homepage, author pages are purged. |
@maxicus Related to the above, I noticed in the W3TC AMP plugin, you actually do seem to attempt to flush AMP urls, except they're hardcoded to https://github.com/W3EDGE/w3-total-cache/blob/master/Extension_Amp_Plugin.php#L67 |
Hi @archon810, We've been chatted about this issue internally, and I think we have a solution. It should be in one of our next releases. I wrote a mock blog post to kind of summarize the idea we're going with. I'll paste the image below so you can see the idea we're going with: Again, hopefully this will be out soon. Let us know what you think! Thanks,
|
Hi @archon810, We're getting close to releasing a minor version that resolves this issue:
Can you share with us what WordPress plugin you're using that is using Thanks |
@bwmarkle As I mentioned above here #34 (comment), we're using the official AMP WP plugin. https://wordpress.org/plugins/amp/ |
Hi @archon810, W3 Total Cache 0.12.0 has been released, which includes amp purge settings. If you have have some time to test, this should resolve the issue at hand. Thanks |
@bwmarkle Thanks for this. There's one small issue that is described here: ampproject/amphtml#24326 (comment). Basically, sometimes Google makes urls with
Can W3 perhaps account for this unfortunate issue? |
@maxicus In addition to that, we will stick with our solution, which only dumps 2 AMP urls per story, since AMP is only enabled on individual posts and not categories/tags/etc, because W3TC's AMP plugin ends up flushing cache for potentially additional 50+ pages that don't even have AMP versions, and this flushing process takes quite a bit of time and slows down post updates. The issue is described here: #44. |
df81570 commit normalizes all ?amp=, ?amp=1 pages to a single cache key so purging of only one entry is enough. But based on your description you have a problem at CDN level where you will have to purge all possible variants unless CDN itself supports masked purge. Not something what plugin may support unless CDN does. You may also note that the root of the problem is querystring-based url structure which allows much more url variants to be made... As a workaround you may consider to canonicalize urls with 301 redirects, like wp core does for some irregular urls. That may help to solve upcoming issues you will potentially have later with ?amp=2, ?amp=3 and ?amp=archon810 urls in your CDN cache :) Drawback is the redirect loop possible if CDN really creates own redirects like you describe in a ticket, but it's not how CDN's usually work (bug in cdn? bug in origin responding redirect sometimes which is later cached?). |
Hi,
We recently rolled out AMP to our site but are now running into issues with AMP pages not getting their W3TC cache cleared.
The regular non-AMP pages get their cached cleared properly upon pressing Update in a post. However, AMP pages (with
?amp
appended), do not, whether the W3TC AMP extension is activated or not.I've looked at all the settings I can find and even tried 0.10 released today, but still AMP does not get updated. This is bad for obvious reasons.
Here's an example of a post I updated many minutes ago.
Regular page:
AMP page (same url with
?amp
appended):@maxicus Any ideas?
Thanks!
This was also cross-posted to https://wordpress.org/support/topic/amp-page-cache-does-not-get-cleared/.
The text was updated successfully, but these errors were encountered: