andrewdavey/cassette — pull request #305 by David-Durst (2012-08-23 19:59:24+00:00)
Title: CDN and Debug Mode Speed Improvements

CDN - Previously, cassette would cache the url created by the modify method of the IUrlModifier in CassetteConfigurations. I split that into two functions: PreCacheModify and PostCacheModify. One can prepend the desired CDN url and programmatically switch it without cassette caching the old value.

Debug Mode Speed Improvements - Using Cassette with approximately 150 bundles significantly slows the development cycle. On a six-core processor with 24 gigs of ram, it takes about 30 seconds to make a change and refresh the page if the site isn't rebuilt. Otherwise, the reload takes about 90 seconds. I decreased these times to about 5 seconds and 30 seconds by caching the bundles on disk and in memory.

In Memory Caching - Previously, when one bundle changed, cassette recompiled all of them. Now, DiskBackedBundleCache stores in them in memory in their post-processing form so that if one has been changed, only that one needs to be recompiled.

On Disk Caching - If the developer re-compiles the site, the assets are not processed. Rather I use files on disk that contain the post-processing forms of the assets. I ensure that, if an asset has changed, I do not serve an older form of the asset by storing files with the following name format: . .