Problem/Motivation
Purge tag headers output all cache tags and can cause issues with response header sizes. Others have proposed cache tag minification to address this matter, and I propose that we add a tag blacklist option to omit tags entirely based on need.
The purge_queuer_coretags submodule provideds such a blacklist for limiting the cache tags being queued for purging.
Proposed resolution
Provide a purge setting form for configuring a purge tag header blacklist.
Remaining tasks
Implement config schema, settings form, testing scenarios, and blacklisting logic
User interface changes
Yes
API changes
No
Data model changes
Yes, config.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | purge-tagsheaders-blacklist-2977563-16.patch | 13.01 KB | shree.yesare |
| #9 | purge-tagsheaders-blacklist-2977563-9.patch | 13.12 KB | artem_sylchuk |
| #5 | tags-headers-blacklist-2977563-5.png | 433.56 KB | bighappyface |
| #5 | tags-headers-dashboard-2977563-5.png | 502.2 KB | bighappyface |
| #2 | purge-tagsheaders-blacklist-2977563-2.patch | 13.78 KB | bighappyface |
Comments
Comment #2
bighappyface commentedThis patch:
purge.tagsheadersconfig topurge.schema.ymlDrupal\purge_queuer_coretags\Form\ConfigurationForminto new formDrupal\purge_ui\Form\TagsHeadersConfigFormDrupal\purge\EventSubscriber\CacheableResponseSubscriberto enforce blacklist for all tags headersDrupal\purge\Tests\TagsHeader\CacheableResponseSubscriberTest::testTagsHeadersBlacklisttest coverageComment #3
bighappyface commentedComment #4
WidgetsBurritos commented+1 RTBC
Seems to be working for me
Comment #5
bighappyface commentedScreenshots:
Comment #7
vegantriathleteWould it be better to create a whitelist? The problem with a blacklist is that it's possible for things to slip through (unnoticed) in the future because somebody forgot to add them to the blacklist. With a whitelist people would need to take an affirmative action to get something new to happen.
Comment #8
azinck commentedI'd agree that a whitelist would be a really nice option, at least.
Comment #9
artem_sylchukHere is the re-roll of the patch, it wasn't applying anymore
Comment #10
pbabin commentedDisregard comment.
Comment #11
luksakIn my case I need exact matches. I want to blacklist
node_list, but that would also matchnode_list:article, which is not what I want.Comment #12
luksakAttached you can find a re-roll.
Comment #13
luksakThis one only checks for exact matches. But I didn't fix anything else. So just ignore this patch in case you don't need that.
Comment #14
luksakOh, I just realized that using prefixes is the way the blacklist of
purge_queuer_coretagsworks already. I don't think that that is optimal, since that gives us less flexibility, but I guess that's is another issue. Please ignore the patch in #13.Comment #15
luksakComment #17
shree.yesare commentedUpdated patch #12 with missing TagsHeadersConfigForm.php
If using acquia_purge module, it will require below change in acquia_purge module.
Comment #19
firewaller commentedThis is great! Some suggestions to make it more viable: