Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Wish: A way to cache precompiler output in development #309

Closed
akheron opened this Issue Sep 3, 2012 · 2 comments

Comments

Projects
None yet
3 participants

akheron commented Sep 3, 2012

I currently have approx. 40 files per page that need precompilation. In production, I use offline cache and everything works great and fast. However in development, precompiling the 40 files takes over 10 seconds. Having to wait this long for each page to load is just too much.

As a workaround, I created wrapper scripts for the compilers (coffeescript, lessc, handlebars) that cache the compilation results in a file, using sha256(input_data + input_filename) as the filename. If the cached file is found, it's contents are returned instead of invoking the compiler. This cuts my page load times to around 3 seconds, which is far more acceptable.

I wonder if it's possible to add this functionality to django_compressor itself. I would be just fine if it compared the mtime of the cached output file to the source file and wouldn't recompile when the cached file is newer. This would only be done when DEBUG=True and COMPRESS_ENABLED=False, of course.

What do you think?

👍
See also #346.

Owner

diox commented Sep 10, 2015

#650 introduces a COMPRESS_CACHEABLE_PRECOMPILERS setting to fix this.

@diox diox closed this Sep 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment