-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fix purging of front page #29
base: master
Are you sure you want to change the base?
Conversation
Purge the parent id if the post is a revision. Fixes CondeNast#27
Hey @simonwistow! Thanks for the PR. As I've walked through this code and thought some more about the problem, I would like to suggest a different direction. Let me give a little background on this to contextualize what I will propose. Fastly is a bit of a unique snowflake in its ability to "tag" cached objects with the surrogate keys. As you know, this is a powerful feature, but has not often been a mechanism that people get to use to purge caches. When I initially began work on this plugin, I did not take advantage of surrogate keys. I used a different mechanism for "group" purges. In the Reviewing this now, the I went back over the primary page types to see what we would be able to purge, specifically in the case of when a new piece of content published, using our two types of purging: Surrogate Keys and Related URL purging (i.e., purging a list of URLs). Here's what I found:
So...the results are the same! There is no reason we cannot purge the same (and even more content) with surrogate keys. The difference is that we need to change our strategy for how we do purges when we publish content for the first time. The big difference is that content should have the post ID surrogate keys once published; however, when new content is published that is not the case. As such, when new content is published, we need to find all of the related surrogate keys and purge them. What I envision is something like the So, the main issue with the current patch is that it only addresses a portion of the issue, not the whole problem. I think the bug has uncovered a bigger problem that needs to be addressed. I also think two changes will help this process:
Fortunately, this problem is related to some purging issues that we are experiencing on WIRED right now. I'm hopeful that I can land these changes as part of fixing the WIRED bug. In the meantime, I can can give you some very simple code that your customers can use to purge the home page when a new post is published. I think that was the original problem and it's a quick fix with a few lines of custom code. |
Purge the front page when a new post is created.
Purge the parent id if the post is a revision.
Fixes #27