eduardokum / laravel-mail-auto-embed

MIT License
166 stars 36 forks source link

Suggestion: Add optional caching to prevent doing unnecessary requests #53

Closed baaskoen closed 8 months ago

baaskoen commented 9 months ago

Description

If I understand correctly, a CURL request will be performed on every image (as seen here: https://github.com/eduardokum/laravel-mail-auto-embed/blob/master/src/Embedder/AttachmentEmbedder.php#L102).

This could potentially be problematic if you send a lot of e-mails subsequently.

Suggestion

Add a config option (defaults to false) that will cache images for a certain duration by using the Laravel Cache facade.

eduardokum commented 8 months ago

Nice! I put this on master, I will some tests before create a tag.

https://github.com/eduardokum/laravel-mail-auto-embed/commit/e41a4b658505bc59910dd14835370631f8211b64