Ticket #529 (accepted defect)
Handle cache invalidation in the minifier
| Reported by: | tboutell | Owned by: | tboutell |
|---|---|---|---|
| Priority: | major | Milestone: | 1.6 |
| Component: | apostrophePlugin | Version: | trunk |
| Keywords: | minify | Cc: | johnnyoffline, jake, agilbert |
| Symfony version: | 1.4 |
Description
Right now the minifier uses the default caching behavior of the server, just as regular files in web/js or web/css would. This isn't terrible, it doesn't make things any worse than they already were. However it would be much better to have .htaccess directives specifying that the jssgz and cssgz files never expire so you can come back to the site without paying a penalty tomorrow.
The trick is making sure you don't get stuck with old versions if they *are* updated. You can do that by keeping a cache version string (a guid) in the asset-cache folder or perhaps someplace less public like data/a_writable. Delete that in the symfony cc hook. When it doesn't yet exist, make sure that you read it after generating and renaming the file just in case someone else won the race to rename it.
Thanks to pghoratiu.

