Use .gzip as extension for pre-gzipped files.

Some versions of Safari are stupid about files with
.gz suffix.
This commit is contained in:
Neil Williams
2011-11-25 21:23:41 -08:00
parent ffb62ff076
commit 1ca4d56b98
3 changed files with 6 additions and 6 deletions

4
.gitignore vendored
View File

@@ -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

View File

@@ -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:

View File

@@ -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