spicywebau / craft-embedded-assets

Manage YouTube videos, Instagram photos and more as first class assets in Craft CMS
MIT License
171 stars 35 forks source link

Feature request: different caching driver #198

Closed arifje closed 2 years ago

arifje commented 2 years ago

Currently this plugin seems to use static file caching only, which is not ideal in load balanced setups. Would be much better if the plugin uses the caching driver that is configured (database, Redis, etc).

Also, it would be nice if we could enable/disable the caching via the plugin config. Because we have multiple webservers, I disabled it in the code. #dirtyhack

Screenshot 2022-03-05 at 16 40 26
ttempleton commented 2 years ago

The plugin used to save copies of embedded asset files in storage/runtime/assets/embeddedassets, then it was switched over to using Craft's data cache (#158) - but it does fall back to looking for a copy of the file if it isn't in the data cache, and then stores into the data cache and deletes the copy if it was found.

Happy to add a setting to disable embedded asset caching entirely, or maybe just that fallback - let me know what you'd prefer.

arifje commented 2 years ago

Hi @ttempleton, thanks for the explanation, sound logical.

One issue remains: when an embed is refreshed, caching doesn't seem to be cleared, so we are still seeing broken embeds, until we clear caching.

ttempleton commented 2 years ago

Ah yep, thanks for pointing that out. Should be fixed now in Embedded Assets 2.10.3.