diff --git a/etc/nginx/vhost.in b/etc/nginx/vhost.in index 0708fe1a9..f92689f59 100644 --- a/etc/nginx/vhost.in +++ b/etc/nginx/vhost.in @@ -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; diff --git a/pandora/app/config.py b/pandora/app/config.py index 422da3bc3..b3d32b245 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -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)