servdhost / craft-asset-storage

MIT License
10 stars 1 forks source link

Add Custom Element to Tags::IGNORE_TAGS_FROM_CLASSES #81

Open BenParizek opened 3 months ago

BenParizek commented 3 months ago

We're looking to migrate a site to Servd Static Cache and the site currently uses Upper and Verbb's SuperTable. We ran into an issue with Upper where the Super Table block element (similar to the Matrix Block) was creating havoc with the cache busting and had to exclude it from the cache logic.

In looking at your code, it appears you exclude the User and MatrixBlock Elements: https://github.com/servdhost/craft-asset-storage/blob/aba85a858c68aa4a64a39c3f676234ed48229e35/src/StaticCache/Tags.php#L21-L24

But there doesn't appear to be an event where we can add additional custom Elements that may require the same treatment.

Could you add an event where we can add custom elements or hard code support for also ignoring the verbb\supertable\elements\SuperTableBlockElement custom Element Type? Currently, I think we'd have to fork the repo and include our patch version in our project directly. I'm open to other solutions I'm overlooking too.

As Super Table has been retired for Craft 5, this will no longer be an issue after Craft 4, but we'll need this on a Craft 4 site until we have a chance to upgrade to Craft 5.

@engram-design