Caching Static Assets in Symfony

I ran into a problem on the Symfony2 page. It seems that there is some caching of static assets on the client side, for example. going zip file. A few hours after the page is refreshed, the old file is downloaded, and then it is updated unexpectedly. I strongly suspect that this may have something to do with the server or some proxy configuration, so I doubt that it has anything to do with Symfony itself, as this makes no sense, but just like checking sanity - also S2 caches such files?

+5
source share
1 answer

Symfony2 uses a cache for assets and pages.

For pages, clearing the cache is easy, this console command is enough

php app/console cache:clear --env=ENVIRONMENT YOUR WORKING IN 

For assets, there are several ways:

Assets installed through symlink may be broken. To restore them:

 php app/console assets:install --symlink 

Assets were installed using a hard copy, so you need to overwrite them after the change:

 php app/console assets:install 

Assets have been dumped. If they are reset, only the dump will update these assets:

 php app/console assetic:dump 

Dump is usually used only in productive environments.

+4
source

All Articles