1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00
phorge-phorge/scripts
epriestley e4df959064 Use Celerity to version all static resources
Summary:
We don't use versioned URIs for images, so when they change users may get old versions.

This was a particular issue with the recent logo change, which several users reported cache-related issues from.

Instead, use Celerity to manage image URI versions in addition to CSS/JS.

This is complicated, because we need to rewrite image URIs inside of CSS, which means the hash of a CSS file has to be derived from the current image data. Otherwise, when we updated an image the CSS wouldn't update, so we wouldn't be any better off.

So basically we:

  - Find all the "raw" files, and put them into the map.
  - Find all the CSS/JS, perform content-altering transformations on it (i.e., not minification) based on the partial map, and then put it into the map based on transformed hashes.

(If we wanted, we could now do CSS variables or whatever for "free", more or less.)

Test Plan:
  - Regenerated celerity map, browsed site, verified images generated with versioned URIs.
  - Moved "blue" flag image over "green" flag image, regenerated map, verified "green" flag image and the associated CSS changed hashes.
  - Added transformation unit tests; ran unit tests.

Reviewers: btrahan, vrana, jungejason

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1073

Differential Revision: https://secure.phabricator.com/D2146
2012-04-08 10:07:51 -07:00
..
aphront Use PhabricatorEnv::newObjectFromConfig() wherever possible 2012-03-21 14:57:52 -07:00
conduit Encode "<" and ">" in JSON/Ajax responses to prevent content-sniffing attacks 2012-02-14 14:51:51 -08:00
daemon Merge __init_env__.php into __init_script__.php 2011-10-02 11:48:09 -07:00
differential Add script to delete revisions without diff 2012-03-30 14:14:38 -07:00
drydock More Drydock Stuff 2012-03-26 20:54:26 -07:00
fpm Minify static resources 2012-03-28 10:13:53 -07:00
install Minor, remove metamta reference from update script. 2012-03-02 06:42:31 -08:00
mail Provide upgrade script for transition away from Meta MTA daemon 2012-03-05 15:15:19 -08:00
repository Provide a script to "undo" the negative effects of an accidental push in Differential 2012-03-13 11:18:22 -07:00
search Merge __init_env__.php into __init_script__.php 2011-10-02 11:48:09 -07:00
setup Test for pcntl availability from the command line, not Apache 2011-05-30 21:02:08 -07:00
sql Customizable MySQL implementation 2012-04-07 10:54:12 -07:00
symbols Add an "--ignore-duplicates" flag to import_project_symbols.php 2012-04-07 17:25:38 -07:00
user Unify logic for username validation 2012-01-16 11:52:59 -08:00
util Add a script to programmatically add image macros 2012-03-09 08:55:11 -08:00
__init_env__.php Support Windows 2012-04-06 09:34:06 -07:00
__init_script__.php Support Windows 2012-04-06 09:34:06 -07:00
celerity_mapper.php Use Celerity to version all static resources 2012-04-08 10:07:51 -07:00