- Issue created by @kevinb623
- π¦πΊAustralia dpi Perth, Australia
The motivation is good, however the implementation needs work
- Status changed to Needs work
10 months ago 6:01am 26 June 2024 - First commit to issue fork.
- πͺπΈSpain omarlopesino
This issue is really interesting, thanks for the contribution @kevinb623 . Supporting queues may drastically improve the performance when there are too many URLs to purge.
Also many thanks for helping reviewing @dpi, it saved me time.
The most priority changes needed to merge this are:
- Make form labels translatable
- Hook install to configure existing sites.
- Coding standards must pass, Currently, this module is integrated with Gitlab CI to help on this purpose.
- Ideally, applying every suggestion mentioned in the feedback.
- πͺπΈSpain jonhattan Plasencia
I thing this is going the wrong direction. Purge API is not being used the right way by the module and thus, by this MR.
Some things I've seen so far:
With respect to the general module implementation
1. The user should not need to choose a processor
Choosing a processor is useless. Despite the processor, it will purge files on the fly when invoking the hook in the middle of the request (not on cron, not on late runtime). Purge's invalidate() requires a processor indeed, but it is not used at all. See https://git.drupalcode.org/project/purge/-/commit/a3632d03ee72b0a09aa1b2...
Instead of processing invalidations on the fly, it should rely on a queue and the system-wide configured processor. Otherwise, on any failure, we're exposed to lose pending invalidations since they're not tracked.
If immediate purge were necessary for some reason, it could be opt-in in the module configuration. This should show a warning message, and not rely on the user choosing a processor, but passing invalidate() any of the enabled processors since it is a required parameter although useless.
2. The module should warn and inhibit, if no
url
(orwildcardurl
) invalidator processor is available.It passes silently if no compatible invalidator is enabled.
With respect to this MR
1. Purge queue is mandatory in purge configuration.
No need to choose a queue.
2. To enqueue items implement a PurgeQueuer plugin and use @purge.queue service
There's an implementation easy to follow in this module: https://git.drupalcode.org/project/url_purge_aggregator/-/tree/1.x/. See https://git.drupalcode.org/project/url_purge_aggregator/-/blob/1.x/url_p...