Added support for automatic purging via cache tags #238
Added support for automatic purging via cache tags #238
Conversation
There was a problem hiding this comment.
Should probably delete this guy and at .DS_Store to the gitignore.
| parent::__construct($configuration, $plugin_id, $plugin_definition); | ||
| $this->settings = QuantPurgeSettings::load($this->getId()); | ||
| // Note: We use the Quant HTTP client rather than the generic Guzzle client. | ||
| $this->client = \Drupal::service('quant_api.client'); |
There was a problem hiding this comment.
I think this can be injected with the create method rather than accessing \Drupal::service here.
Update doc block.
Remove extraneous quote.
kepol
left a comment
There was a problem hiding this comment.
Haven't reviewed everything but there seems to be consistencies in "purge" vs "purger" and some probably should change
modules/quant_purger/config/schema/quant_purger.data_types.schema.yml
Outdated
Show resolved
Hide resolved
modules/quant_purger/src/Plugin/Purge/Purger/QuantPurgeBase.php
Outdated
Show resolved
Hide resolved
modules/quant_purger/src/Plugin/Purge/TagsHeader/QuantCacheTagsHeader.php
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,10 @@ | |||
| quant_purge_header: | |||
There was a problem hiding this comment.
I'm not clear what this is being used for
| /** | ||
| * Helper class that centralizes string hashing for security and maintenance. | ||
| */ | ||
| class Hash { |
There was a problem hiding this comment.
Would this make sense as a general utility instead of just in quant_purger?
There was a problem hiding this comment.
Or not because it's dealing with cache tags?
| * | ||
| * @var string | ||
| */ | ||
| public $invalidationtype = 'tag'; |
There was a problem hiding this comment.
We also have 'path' listed so why is this just tag?
| * {@inheritdoc} | ||
| */ | ||
| public function getFormId() { | ||
| return 'quant_purger.configuration_form'; |
There was a problem hiding this comment.
Is this supposed to be the same as the id for the queuer config form?
|
@stooit @steveworley There was a lot of extra/unnecessary complexity (e.g. abstract base classes) and naming confusions in the code because the queuer plugin was added first and called "Quant Purger" and then the actual purger plugin was added in this. I have tried to refactor things and not only clear up the confusion between these two plugins but also some other things while I saw them. Before I do a bunch of testing, please review the state of the PR to see if you notice anything I screwed up. |
cache-keysheader with appropriate cache tag values