mojoconf / MCT

nothing to see here yet, move along
7 stars 1 forks source link

Using assetpack for fewer roundtrips to the server and to avoid cloudflare caching issues #34

Closed jhthorsen closed 9 years ago

jhthorsen commented 9 years ago

To make changes to the assets while developing, I suggest setting MOJO_ASSETPACK_NO_CACHE=1, which will generate a new asset on each request.

The nice thing about using an assetpack, is that it generates a new name for the resource on each change, so the users on the other end will be forced to download a new asset.

Browsers will probably not download a new version of main.css, even if you change v=1 to v=2:

<link rel="stylesheet" href="/css/main.css?v=1">

Assetpack on the other hand generates an asset with a checksum, so the browser need to download a new file when something has changed:

<link rel="stylesheet" href="/packed/mojoconf-ae57ff942b380f98ca4b717d58e9f6ce.css">