-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to "reset" cache of rendered files automatically in Twig #90
Comments
This was referenced Apr 22, 2020
Allow getCssFiles/getJsFiles in EntrypointLookup return files without filtering already returned
#87
Open
Warxcell
added a commit
to Warxcell/webpack-encore-bundle
that referenced
this issue
Mar 19, 2021
Warxcell
added a commit
to Warxcell/webpack-encore-bundle
that referenced
this issue
Mar 19, 2021
weaverryan
added a commit
that referenced
this issue
Feb 10, 2022
@weaverryan are you sure the linked MR fixes this for the messenger case as well?
|
You're right - it didn't address the Messenger side of things. However, I think (but I am doing some guessing) that this will be handled via the new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related #87
When you
encore_entry_link_tags()
orencore_entry_script_tags()
tags, the bundle "remembers" which CSS and JS files have been rendered and avoids rendering them again. This is by design: it allows you to render multiple "entries" on the same page and avoid link/script tags for the same CSS & JS files (due to code splitting).But, this has some nasty side effects. One practical one is sending emails and using these functions to import your CSS. If you have Messenger installed, each Email is technically rendered twice - and the second (real) email will contain no CSS link tags. The problem is probably worse when sending emails through the queue - as I think once a worker has sent one email, the rest won't contain CSS link tags.
The best solution would be to reset "automatically" the cache after a "main" Twig rendering (e.g. a call to
$twig->render()
) but no such concept currently exists in Twig.A more immediate solution may be to allow users to "opt out" of the cache via some argument to
encore_entry_link_tags()
.The text was updated successfully, but these errors were encountered: