Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

asset compression #77

Closed
sakulstra opened this issue Nov 12, 2014 · 5 comments
Closed

asset compression #77

sakulstra opened this issue Nov 12, 2014 · 5 comments

Comments

@sakulstra
Copy link

Hay there,
i'm looking for sth. like http://django-pipeline.readthedocs.org/en/latest/compressors.html for tinkerer.
Is there any option/plugin for asset compression?
Actually i never worked with sphinx or tinkerer, but i can't believe there is no such extension.

Thanks in advance,
Lukas

@vladris
Copy link
Owner

vladris commented Nov 12, 2014

There currently isn't any plugin for Tinkerer (or Sphinx as far as I know, though I might be wrong). That being said, since this is all static, you should be able to easily run a post-build script on your output directory and compress things if needed. Or serve your static website through django with django-pipeline.

A plugin that does this automatically sounds like a good idea actually, though I don't know when I'll personally get around to implementing it. I'll leave this on the issue tracker though, maybe someone else wants to do it. Should be a post-build step that updates the css and js files in the output directory.

@sakulstra
Copy link
Author

Hay @vladris,
thanks for ur answer - yeah i couldn't find sth. like that but I couldn't image that noone has tried this yet... there are huge documentations(like cakedocs) which could produce sth. like 30% less traffic with compressed sources :D
Actually I've no experience in python, so I wont be able to write a plugin, but mod_pagespeed seems to have some compression plugin build in. So that's no solution for people hosting on github, but for everyone who has low-level access(like on a vServer).
Regards,
Lukas

@vladris
Copy link
Owner

vladris commented Nov 13, 2014

Well, if you're not serving from GitHub or another free host, you might as well set up the compression on the server you are using (you can totally serve a Tinkerer blog with Django for example). That being said, I agree an extension to do the compression after each build wouldn't be a bad idea if anyone wants to build one.

@sakulstra
Copy link
Author

Just found this: https://webassets.readthedocs.org/en/latest/generic/index.html#quick-start , havn't tested it yet cause my python knowledge is so bad - but shouldn't be that hard to use it with sphinxlike systems. If i understood right, one could simply add all *.js and all *.css files inside _static/ to a bundle and run the compression.

@sakulstra
Copy link
Author

I created a simple extension documented here:
http://sakulstra.github.io/blog/html/2015/04/18/asset_compression_in_tinkerer_and_sphinx.html
it's nor perfect at all :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants