I hit #2881045: Add/remove sessionless requests only which for my use case I really need that not happening. The proposed solution there was a bit arbitrary. I know it's a setting, but it addressed only the session part and although it might work most of the time, there might be use cases where the session is there but you still might be a cacheable response.
I also sensed that there's never a proper expiry of the url from the registry, which might make sense to have it.
I am proposing a different approach with the following modifications:
- Add an expire column to the registry as well as a configuration for it. It defaults to 0, same behavior as before. Patch includes update hooks for both the config and the table.
- Do not clear the registry when max age is < 1 and when the response is 200: Leave it as not to registered, but not remove it.
- Adds a cron entry to remove expired entries, if configured.
| Comment | File | Size | Author |
|---|
Issue fork purge_queuer_url-3045503
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
hanoiiAttached is the patch for this.
Comment #3
hanoiiForgot an use statement on the install file/
Comment #4
hanoiiSet the current db items to -1 so they are not automatically expired, which is the default. Any change on this setting will slowly change the registry.
Comment #5
lisa.rae commentedMarking needs work, patch failed to apply
Comment #6
hanoiiAttached is a re-rolled patch against 1.0.
Bear in mind that I am changing the dependency pattern into a setter injection, instead of constructor so that this module doesn;t have to play catch up with parent dependencies but only add what it needs.
Comment #7
hanoiiPrevious patch has an error due to the re-roll.
Comment #8
hanoiiComment #9
hanoiiAnother quick fix to the patch.
Comment #11
hanoiiHiding patch, work is now on the fork/MR.
Comment #13
szato commentedRebased MR and added 2 extra commits:
Comment #14
ericgsmith commentedI think this is something that the module should be doing and the approach looks sensible to me - thank you.
I looks like an unintended change was introduced that broke the tests - I think we will also need more test coverage that the expiration is working.
Comment #15
ericgsmith commentedHave fixed the existing test and taken a closer look.
I think we need to be mindful here for pages using the internal page cache module.
The behaviour for page_cache is permanent by default:
While some setups will have the internal page cache disabled and rely only on an external page cache, not all will.
If page cache is enabled, it looks like the url registry item is removed after expiration, but as the page cache entry is permanent it will remain and continue to be returned by Drupal this never gets added back to the registry because of:
I haven't thought too much on this - perhaps we can just return TRUE here? We don't introduce anything negative for sites without page cache, as the response won't have that header.
Comment #16
ericgsmith commentedWill need a rebase after #2912139: Logged-in requests remove items from traffic registry comitted.
While that related issue is committed I am still keen on this idea as a solution.