Skip to content

Commit

Permalink
Use .gzip as extension for pre-gzipped files.
Browse files Browse the repository at this point in the history
Some versions of Safari are stupid about files with
.gz suffix.
  • Loading branch information
spladug committed Nov 29, 2011
1 parent ffb62ff commit 1ca4d56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions r2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions r2/r2/lib/template_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ca4d56

Please sign in to comment.