We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

How I can cache the assets.outputCss ?

How I can cache the assets.outputCss ?

I want't to generate the css file every time,if it exists. so I want to cache.



11.6k

asset are generated each time controller is called, search the forum, somewhere a topic is about not re-minifying each time assets, the solution given could help you. Simpliest solution is not to use assets, so you can setup ressources lifetime caching at server config level



145.0k
Accepted
answer
edited Jul '16

The easiest way is to join all assets into one file and add some query parameter which will be checked, like ?flush or something like this, if it occurs - then generate new css - if not - then don't and use file already stored.



85.5k

i use gulp/grunt for my js/scss. They are just made for that purpose and requires few hours in order get use to them