We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Assets with query string

Hi!

In my projet, we use a CDN/reverse proxy cache.

Right now, my assets looks like: "/js/custom.js". However, if I update this file, the cache must be invalidated in CDN (on cloudfront it can take few hours...).

We can use a tip, use the filemtime (timestamp format) as query string. Like: "/js/custom.js?1498555509". If i update my js file, the HTML generates a new timestamp.

I tried to hack Phalcon\Assets\Manager and Phalcon\Assets\Collection. But i don't like my code (too dirty). Anyone found a good a way?

Cheers!

It should be fairly easy. I don't have access to the project at the moment, but surely I remember we did something KISS with it, so in the end our assets looked like style.css?v=1.2.

What is your (dirty) solution?