create gzip version of js files

This commit is contained in:
j 2012-01-02 18:23:46 +05:30
parent 2d36ca047e
commit f37e390fcb
2 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@ server {
#those need to go into /etc/nginx/nginx.conf in the http section
#gzip on;
#gzip_static on;
#gzip_http_version 1.1;
#gzip_vary on;
#gzip_comp_level 6;

View File

@ -91,6 +91,15 @@ def update_static():
with open(pandora_json, 'w') as f:
json.dump(sorted(js), f, indent=2)
for f in (pandora_js, pandora_json):
os.system('gzip -9 -c "%s" > "%s.gz"' % (f, f))
for root, folders, files in os.walk(os.path.join(settings.STATIC_ROOT, 'oxjs/build')):
for f in files:
if os.path.splitext(f)[-1] in ('.js', '.json'):
f = os.path.join(root, f)
os.system('gzip -9 -c "%s" > "%s.gz"' % (f, f))
for size in (16, 64, 256):
pandora = os.path.join(settings.STATIC_ROOT, 'png/pandora/icon%d.png'%size)
image = os.path.join(settings.STATIC_ROOT, 'png/icon%d.png'%size)