-
Notifications
You must be signed in to change notification settings - Fork 141
CDN and Debug Mode Speed Improvements #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Use the bundles dictionary in cassette settings to cache bundles. Only process ones that have changed rather than all bundles everytime a file is changed.
Hi David, thank you for digging into these performance issues. It's great to see Cassette being used on a large project, and getting improved as a result! I've been getting ready for Cassette v2 over in the v2 branch. This has significantly diverged from master, so merging may be tricky! I may end up cherry picking commits/ideas into v2 instead. It would be very useful to have an integration test suite that simulates a large number of bundles. Can you provide more detail on the size and make-up of your 150 bundles? e.g. number of assets per bundle, number of types of bundle (script, stylesheet, htmltemplate), coffeescript, less, etc? Thanks again for all the work you've put into Cassette :) |
Will this get into v2.1? |
It makes sense for Cassette v2.1 to focus on improving performance. So I will certainly be using this pull request for inspiration. I won't be introducing breaking API changes though. So some things may be rolled in v3, or altered to not change public interfaces. |
I've created a new branch https://github.com/andrewdavey/cassette/tree/perf where I'm experimenting with performance improvements for the v2 code base. Changing one asset file while the application is running in debug mode now results in only the one bundle being re-processed, instead of all bundles. I've also made a few other perf tweaks. |
Sorry! I was an intern at ZocDoc this summer and now I'm back at school. |
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.