-
Notifications
You must be signed in to change notification settings - Fork 18
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
Important option missing: Auto-Purge "RSS Feeds" Too? #182
Comments
@sarangandk Thank you very much for reporting this important bug! The development window has closed on the current release, but I'm going to mark this is a priority item to work on for the following release (after the one coming out this week, for which development has already been halted). |
I'm looking at this again and it looks like this feature is actually going to be a bit challenging to implement. That said, I do agree that this is a priority item and needs to be added ASAP. In fact, it's as important as the auto-purge posts page and home page feature, as the publishing of a new post would currently render cached feeds out of date. Feed Caching is disabled by default in Quick Cache, but if a site owner enables this feature, it is currently broken, as it will result in outdated feeds. Scenarios where Feed Caches should be purgedAuto-Purge Comment Post CacheWhen Auto-Purge Home Page CacheWhen Auto-Purge Posts Page CacheWhen Auto-Purge Post Terms CacheWhen Clearing the term cache will actually be quite tricky because you can build multi-term feeds on the fly. For example, to create a feed that includes all posts with Because this is going to require quite a bit of work, I'm going to push this issue to the Future Release milestone, so that I can push out in the Next Release all of the bugfixes that are ready to go out right now. This issue will be a priority item for the next release cycle. |
Assigning this to myself. |
@raamdev If I think we need to consider author-related feeds too? |
OK, I have the ones you listed covered now.I am also adding feed purging for
|
I have reviewed the code you committed to the Regarding this comment in wpsharks/comet-cache-pro@1ecaf51: // @TODO @raamdev I think it would a good idea to reverse the logic here to match other routines.
// Perhaps we could check for a negated condition and stop before proceeding; instead of the other way around. I agree. Feel free to flip that around as part of this issue if you'd like. |
Roger that. Thanks! |
@raamdev PRs submitted for review. My tests indicate this is working correctly in all cases. However, I would suggest further testing by another pair of eyes. That said, I feel it's ready to be merged into the dev branch. Here a couple of screenshots taken from the pro version. There is one minor limitation that I noted here. It is related to mixed feed variations for term-related feeds that are using query string variables. While this implementation does support feed URLs that use query string variables (in case a site owner is caching feeds, and also caching GET requests) that will be fine. This routine can handle it. However, mixed feeds (e.g. |
@raamdev This has been enabled in both the lite/pro versions. However, there is no ability turn off feed-related Dashboard notices for feed purging, and there is no ability to disable feed purging either; in the lite version. Actually, if feed caching is disabled in the lite version, feed purging will not run. That would be one way to do it in the free version; even though there isn't a separate config option for disabling feed purging in the lite version. |
Perfect. That's exactly what I was thinking would be the difference between Lite and Pro with regards to this feature. Thank you.
Thank you. I will review these today. |
Further testing shows a possible issue.
On the one hand, feed URLs probably should not be cached at all. If they are, GET requests shouldn't be cached. Therefore, I don't see cached feed URLs with a query string being a common occurrence at all; i.e. this is an edge case in my view. On the other hand, it would be nice if QC could cover this format, even when the permalink structure is set to one of the SEO-friendly options. Just in case a site owner is using SEO-friendly permalinks, is also allowing GET requests to be cached, and they are also allowing feed URLs to be cached that use the query string variations. Not sure why that would that ever occur. As I said, edge case. lol As it stands now, QC will handle feed URLs using the query string format, but only if SEO-friendly permalinks are NOT in use. i.e. if the WP core function To clarify further, the purging routine is looking at one format or the other, based on the way WordPress has been configured. If WordPress is configured with an SEO-friendly permalink structure, we look at URLs like |
I agree that we should support SEO-friendly permalinks + auto-purging for feed URLs with query strings (e.g., I've seen query strings used quite frequently with regards to WordPress feeds, especially if a site owner has done any customization to the way feeds behave. For example, on my personal site I have it setup so that I can request a feed of all posts with format "Aside" using All of that said, I'm quite happy to treat this as a separate "bug", to work on for a future release. I'm more concerned with getting feed purging for SEO-friendly URLs pushed out (which is likely a far more common scenario). To recap: The scenario that we need to address is the one where the site owner is using SEO-Friendly permalinks, has GET Request caching enabled, and is using Feed URLs that contain query strings. In that scenario, the cache files generated for those Feed URLs (with a query string) would not be purged by this new auto purge routine and instead would only get purged when they expire or when the cache is manually cleared. I think the best solution here would be for the feed purging routine to simply look for both SEO-friendly cache formations and query string formations when GET Request caching is enabled (that's the only scenario where both types might get cached). When GET Request caching is disabled (the default), the feed purging routine should only consider SEO-friendly cache formations (which is what the new routine currently takes care of as of this comment). |
Yes, I agree with this too. I also realized that when/if this occurs, the only they would ever be cached (i.e. the query string variations) is if the site owner is also allowing GET requests to be cached too. If they are using SEO-friendly permalinks, there is very little reason to allow GET requests to be cached. Making this case even less likely to occur. I would agree with treating this as a separate issue; i.e. as an improvement to come later. What I can do in this issue, is add the query string variations for those which are the most common. Still, I think a separate issue could be created so that we can come back and take a much closer look at this specific scenario again in the future. I will post another commit or two soon to help close the gap a little. |
…che_path()` bug fix. See wpsharks/comet-cache#182
Found a minor bug in I updated |
Ugh. I just added the query string variations for a case where fancy permalinks are in use; just to cover all the bases. Only to test further and discover that WordPress There are still variations to consider though. Back to the drawing board on that one. |
WordPress
Author feeds are partially rewritten. Same with term-related feeds (partially rewritten). |
…endly permalinks. We now consider `redirect_canonical()` as well. See wpsharks/comet-cache#182
…endly permalinks. We now consider `redirect_canonical()` as well. See #182
@raamdev I've got the query string variations covered for authors and terms (in every way I found possible); i.e. whenever GET request caching is enabled, feed caching is enabled, and the WordPress-generated feed URLs are using an SEO-friendly format. After some initial testing, we are now also considering That covers just about all the bases. A second round of testing looks pretty good. Let me know if you spot anything that needs further attention. |
I don't see it being possible to detect things like this. Query strings are not something that should ever be cached in my view. The only partially-legitimate reason for us to support the caching of GET requests, is to support the default WordPress behavior where fancy permalinks are disabled. For that matter, I think WordPress should not even have this option for site owners. I can't think of a single good reason to support query strings in permalinks. Anyway, that's another discussion. Opinions aside, QC currently caches GET requests (i.e. if a site owner chooses to turn this on and goes against the advice presented in the Dashboard); each query string is converted to an MD5 hash via I still agree that we should set aside a separate issue to reference the limitations mentioned in this issue. That way if something changes or improves in the future we can come back and take a closer look. Regarding I think Quick Cache should continue to discourage the caching of GET requests for the same reason that search engines discourage them. There are too many possibilities. Even the order of query string variables can make a difference in the way a server handles a request. It will certainly make a difference in the format of the URL. I even think it would be OK if at some point we decided to remove support for GET requests in Quick Cache entirely; i.e. if you want to cache your site, enable fancy permalinks. |
This was addressed in the most recent commits. We now detect known query string formats that occur after |
@jaswsinc Thanks for all your work on this! It sounds like it turned out to be a much better PITA than it seemed. :(
So that means it's not currently possible to selectively purge cached GET Requests, correct? The only way to clear cached GET Requests is to let the cache files expire on their own or to manually clear the cache. Do I have that correct? If that's correct, I think that's fine. I haven't heard any reports of site owners needing to selectively clear cached GET Requests, so we can worry about that if/when someone submits a feature request.
So that covers all scenarios for Feed caching where standard query strings might be used (i.e., the In such a scenario, where custom feed query strings are in use and GET Request caching is enabled, and SEO-friendly permalinks are enabled, those feed URLs with custom query strings will get cached, but will not be purged via the automatic feed purging routines. Those cache files would only get purged when they expire on their own or when a site owner manually clears the cache. Is that correct? |
Yep, that's right. Feed URLs with custom query strings would not be identified as being feed URLs by Quick Cache. A manual cache clear would be needed to purge these at present. |
Correct. It's possible to identify known patterns and purge cached GET requests for something like |
Yep, this was a bit of work. I learned a few things about WP feeds out of this though. |
@jaswsinc So are PRs #271 and wpsharks/comet-cache-pro#73 ready to go, as far as you can tell? I'll be sure to test this thoroughly during the release candidate period. |
Yes, these are both ready to merge. I'm not aware of any remaining issues at this time. |
Closed by PRs #271 and wpsharks/comet-cache-pro#73. Thanks @jaswsinc! |
In quick cache Version 140520..
As there options like "Auto-Purge "Author Page" Too?", Auto-Purge Designated "Home Page" Too? etc. a very important option is missing.
That is an option to set to refresh/clear the caches for RSS Feeds when making any changes in posts, adding new posts etc.
Because I see when I add new posts to WordPress, the RSS feed caches are not cleared automatically and we need to clear that manually everytime.
In my sites I have authors, who have not access to Quick Cache settings to clear the caches when they add new posts.
Please add that option ASAP.
Thanks in advance.
The text was updated successfully, but these errors were encountered: