mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Use .gzip as extension for pre-gzipped files.
Some versions of Safari are stupid about files with .gz suffix.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -33,8 +33,8 @@ r2/myproduction.ini
|
||||
.DS_Store
|
||||
r2/r2.egg-info/**
|
||||
r2/r2/public/static/sprite*.png
|
||||
r2/r2/public/static/*.gz
|
||||
r2/r2/public/static/js/lib/*.gz
|
||||
r2/r2/public/static/*.gzip
|
||||
r2/r2/public/static/js/lib/*.gzip
|
||||
r2/r2/lib/_normalized_hot.c
|
||||
r2/r2/lib/mr_tools/_mr_tools.c
|
||||
r2/r2/lib/db/_sorts.c
|
||||
|
||||
@@ -167,13 +167,13 @@ clean_names:
|
||||
|
||||
#### gzip!
|
||||
GZIPPABLE := $(filter %.css %.js,$(MANGLED_FILES) $(STATIC_DIR)/js/lib/jquery.js)
|
||||
GZIPPED := $(addsuffix .gz,$(GZIPPABLE))
|
||||
GZIPPED := $(addsuffix .gzip,$(GZIPPABLE))
|
||||
|
||||
.PHONY: clean_gzip
|
||||
|
||||
gzip: $(GZIPPED)
|
||||
|
||||
$(GZIPPED): %.gz: %
|
||||
$(GZIPPED): %.gzip: %
|
||||
gzip -c $< > $@
|
||||
|
||||
clean_gzip:
|
||||
|
||||
@@ -81,12 +81,12 @@ def static(path, allow_gzip=True):
|
||||
scheme = 'http'
|
||||
domain = g.static_domain
|
||||
query = None
|
||||
suffix = '.gz' if should_gzip and g.static_pre_gzipped else ''
|
||||
suffix = '.gzip' if should_gzip and g.static_pre_gzipped else ''
|
||||
elif c.secure and g.static_secure_domain:
|
||||
scheme = 'https'
|
||||
domain = g.static_secure_domain
|
||||
query = None
|
||||
suffix = '.gz' if should_gzip and g.static_secure_pre_gzipped else ''
|
||||
suffix = '.gzip' if should_gzip and g.static_secure_pre_gzipped else ''
|
||||
else:
|
||||
path_components.append(c.site.static_path)
|
||||
query = None
|
||||
|
||||
Reference in New Issue
Block a user