create gzip version of js files
This commit is contained in:
parent
2d36ca047e
commit
f37e390fcb
2 changed files with 10 additions and 0 deletions
|
@ -5,6 +5,7 @@ server {
|
||||||
|
|
||||||
#those need to go into /etc/nginx/nginx.conf in the http section
|
#those need to go into /etc/nginx/nginx.conf in the http section
|
||||||
#gzip on;
|
#gzip on;
|
||||||
|
#gzip_static on;
|
||||||
#gzip_http_version 1.1;
|
#gzip_http_version 1.1;
|
||||||
#gzip_vary on;
|
#gzip_vary on;
|
||||||
#gzip_comp_level 6;
|
#gzip_comp_level 6;
|
||||||
|
|
|
@ -91,6 +91,15 @@ def update_static():
|
||||||
with open(pandora_json, 'w') as f:
|
with open(pandora_json, 'w') as f:
|
||||||
json.dump(sorted(js), f, indent=2)
|
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):
|
for size in (16, 64, 256):
|
||||||
pandora = os.path.join(settings.STATIC_ROOT, 'png/pandora/icon%d.png'%size)
|
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)
|
image = os.path.join(settings.STATIC_ROOT, 'png/icon%d.png'%size)
|
||||||
|
|
Loading…
Reference in a new issue