ostark / upper

Integrates Edge Caches like Fastly, KeyCDN, Cloudflare and Varnish with Craft.
MIT License
102 stars 22 forks source link

Trigger purge before/after events #34

Closed timkelty closed 4 years ago

timkelty commented 5 years ago

Since it was unused, I change PurgeEvent to fire for each tag, instead of the tags array.

I added a EVENT_BEFORE_PURGE for devs could manipulate and/or filter out tags, and EVENT_BEFORE_AFTER for anything else.

ostark commented 5 years ago

Thanks, l'll review it asap

timkelty commented 5 years ago

FWIW I don't have a particular need for both events, if you think it is overkill. The before hook is probably more useful, since you can manipulate the tags.

My use-case is purging cached 404s (e.g. when a URL changes)…so I would probably use the before hook and add the tag for the 404 entry.

Related: https://github.com/ostark/upper/issues/22