Closed lukasz-zaroda closed 6 years ago
@lukasz-zaroda I understood this as "var/cache/" is read-only for you, dear developer, but it's a read-write dir for Symfony. But as you said, the "read-write" part is tricky, because you only write once, during app bootstrap/compilation, and read that forever. So, creating a different dir for this, as you propose, could make sense.
Maybe something could be done during container compilation: separate "forever" directories and "maybe could be updated" ones.
For example, templates can be compiled and saved by the templates cache warmer and saved forever, because it finds every template in your app, and you're never likely to create templates on-the-fly and save them in cache at runtime.
Contrary to application cache (the default cache.app
service) which is using a filesystem adapter, this is used for application cache and may need invalidation, so it needs read AND write rights.
Is there any statistics/documentation about the things that are warmed-up by Symfony and that are 100% sure to be fixed in time (until next deploy)?
Closing as this is not related to Flex and @nicolas-grekas referenced an issue discussing the matter on symfony/symfony.
I was making myself up to date with Symfony 4, and here Fabien wrote this:
First thought:
I didn't find anyone complaining so I decided to write this. Isn't it a problem? By making
var/cache
read-only aren't we introducing a new, important type of code - compiled code, which deserves its own directory, likebuild
for example? Maybe that directory could also contain CSS compiled from SASS in the long run and such? This directory could be read-only and be build only once before deploying the app.I'm not suggesting that it should be the case, just asking what the community thinks, because I'm curious.