Skip to content

Commit

Permalink
Make static not cacheable.
Browse files Browse the repository at this point in the history
Fixes meteor#631.

Update the dev_bundle to use the Meteor version of gzippo which allows
clientMaxAge to be set to 0, and change server.js to set the
clientMaxAge to 0 for static.
  • Loading branch information
awwx authored and n1mmy committed Feb 8, 2013
1 parent 66c94bf commit d4534c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions admin/generate-dev-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e
set -u

BUNDLE_VERSION=0.2.16
BUNDLE_VERSION=0.2.17
UNAME=$(uname)
ARCH=$(uname -m)

Expand Down Expand Up @@ -78,7 +78,6 @@ which npm

cd "$DIR/lib/node_modules"
npm install [email protected] # not 2.x yet. sockjs doesn't work w/ new connect
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
Expand All @@ -101,6 +100,10 @@ npm install [email protected]
npm install [email protected]
npm install [email protected]

# allow clientMaxAge to be set to 0:
# https://github.com/tomgco/gzippo/pull/49
npm install https://github.com/meteor/gzippo/tarball/1e4b955439

# uglify-js has a bug which drops 'undefined' in arrays:
# https://github.com/mishoo/UglifyJS2/pull/97
npm install https://github.com/meteor/UglifyJS2/tarball/9a4d0d86ed
Expand Down
2 changes: 1 addition & 1 deletion app/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var run = function () {
var static_cacheable_path = path.join(bundle_dir, 'static_cacheable');
if (fs.existsSync(static_cacheable_path))
app.use(gzippo.staticGzip(static_cacheable_path, {clientMaxAge: 1000 * 60 * 60 * 24 * 365}));
app.use(gzippo.staticGzip(path.join(bundle_dir, 'static')));
app.use(gzippo.staticGzip(path.join(bundle_dir, 'static'), {clientMaxAge: 0}));

// read bundle config file
var info_raw =
Expand Down
2 changes: 1 addition & 1 deletion meteor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

BUNDLE_VERSION=0.2.16
BUNDLE_VERSION=0.2.17

# OS Check. Put here because here is where we download the precompiled
# bundles that are arch specific.
Expand Down

0 comments on commit d4534c5

Please sign in to comment.