To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #529 (accepted defect)

Opened 18 months ago

Last modified 14 months ago

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.

Change History

Changed 18 months ago by tboutell

  • status changed from new to accepted

It might be possible to write to a PHP file in the Symfony cache to get this autoloading with other settings.yml/app.yml settings but it's a bit obscure and possibly not worth it. The OS should do an efficient job caching reads to the file.

Changed 14 months ago by geoffd

  • milestone changed from 1.5 to 1.6
Note: See TracTickets for help on using tickets.