- 🇫🇮Finland masipila
I'm testing (and reading) the patch #57.
+/** + * Implements hook_purge_cache_tags_simplify_dictionary(). + */ +function purge_purge_cache_tags_simplify_dictionary() { + // Most common list cache tags. + return [ + 'config:block_list' => '/^config\:block\./', + 'menu_link_content_list' => '/^menu_link_content\:/', + 'media_list' => '/^media\:/', + 'node_list' => '/^node\:/', + 'file_list' => '/^file\:/', + 'taxonomy_term_list' => '/^taxonomy_term\:/', + 'user_list' => '/^user\:/', + ]; +}
Could somebody please elaborate once more what's the conceptual logic behind this?
Isn't it so that:
- An individual node page, will only have node:42 cache tag
- But a View that renders nodes will have also node_list (and node_list:) so that whenever new nodes have been created, the Views that render these nodes will be invalidated.
So are we throwing away the node:xxx tags if and only if also the node_list tag is also present? In other words, the individual node pages would still have the node:xxx cache tags?
If my thinking-out-loud is correct here, can we please elaborate the documentation block of purge_purge_cache_tags_simplify_dictionary()?
Cheers,
Markus - 🇺🇸United States afinnarn
I'm not sure how helpful this comment is, but I tried the patch in #54 and got the following error.
The website encountered an unexpected error. Please try again later. ArgumentCountError: Too few arguments to function Drupal\purge\Plugin\Purge\TagsHeader\TagsHeaderBase::__construct(), 3 passed in /var/www/html/docroot/modules/contrib/acquia_purge/src/Plugin/Purge/TagsHeader/AcquiaCloudSiteHeader.php on line 41 and exactly 4 expected in Drupal\purge\Plugin\Purge\TagsHeader\TagsHeaderBase->__construct() (line 32 of modules/contrib/purge/src/Plugin/Purge/TagsHeader/TagsHeaderBase.php).
I had to switch to other work and didn't have time to look into the error, but I will update the thread if I do. Posting since someone else might encounter the error or know how to fix in a patch.
- 🇺🇸United States afinnarn
Okay, the relevant patch in the Acquia Purge module is here and it says to re-roll into this patch: https://www.drupal.org/project/acquia_purge/issues/3157178 →
I will look into this now in my local dev environment.
- 🇧🇪Belgium bceyssens Genk 🇧🇪
I'm not a fan of the hashing solution as you have no idea what the content is. The dictionary looks like a lot of work to maintain.
As an alternative method I added compression strategy, keeping only the first letter of each word. It is fully automated and you could still retrieve the original cache tag.As you should still have the option to disable minification logic completely, I changed the configuration form to a select.
Example minitication ratios (number of characters in the cache tags header):- None: 4030
- Dictionary: 2337
- Compress: 1300
- Hash: 734
- 🇦🇺Australia swatigarg06
I tested patch #63 and it seems to be failing for 8.x-3.4.
I rerolled an older patch for the new version of the module.
- 🇺🇸United States dasginganinja Bethlehem, PA
I just went through the past issues and tried to get an understanding of what's going on in this thread. Hopefully this summary helps guide this issue towards an actual patch.
I was starting with patch #49.
There is a MR for this thread that is based on #49 available here: Merge Request !5
Notes for #49 patch / #66
- Patch by default uses MD5 with first 4 characters in #49 and what is expected with this patch for those who has applied it
- Patch 66 seems like it's #49 version rerolled
- Patch #51 can be added to #49 to limit it to just being tags. This is an issue with path invalidation cases and should be applied.
- This does not have any configuration / schemaNew functionality / schema changes in #61/63
- Seems like there is a lot of configurability in these -- good work!
- 61 vs 63 was the latest comparison for the _NEW_ work for alternate methods of shortening tags
- Both contain dictionary and MD5 approaches
- 63 has a new "compress" function as well as all the previous work (except #50?)
- 63 changes from simplification_logic to minification_logic configuration key. This means that anybody on simplification_logic key will need to migrate to that. Perhaps we fall back to the previous simplification_logic key?
- 63 will allow the original tag through if there is no config or it is set to null
- 61 will default to md5 if the simplification_logic config is not presentMissing functionality overlooked in #51 as this logic applies to path type expressions as well. This should be incorporated into all of these patches.
I think it would be great if #61 / #63 could be combined into a similar request, using the simplification_logic key. The code in #63 is a lot easier to read FWIW.
I hope this helps move things forward.
- 🇨🇦Canada druplr
Here is @mattbloomfield's patch #66 (which as @dasginganinja indicated, is #49 rerolled) with whitespaces corrected. This does not include the new functionality / schema changes in #61/63.
Thanks druplr. I used your patch to reroll #61. I saw #63 was failing, so I'm not sure what we might want to do with that.
- 🇧🇪Belgium michel.g
Add a check on TagInvalidation because this code was also replacing tokens on other validators (e.g. URL)