mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Don't cache an error that is served as 200
This commit is contained in:
@@ -659,8 +659,13 @@ var runWebAppServer = function () {
|
|||||||
if (request.url.query && request.url.query['meteor_css_resource']) {
|
if (request.url.query && request.url.query['meteor_css_resource']) {
|
||||||
// In this case, we're requesting a CSS resource in the meteor-specific
|
// In this case, we're requesting a CSS resource in the meteor-specific
|
||||||
// way, but we don't have it. Serve a static css file that indicates that
|
// way, but we don't have it. Serve a static css file that indicates that
|
||||||
// we didn't have it, so we can detect that and refresh.
|
// we didn't have it, so we can detect that and refresh. Make sure
|
||||||
|
// that any proxies or CDNs don't cache this error! (Normally proxies
|
||||||
|
// or CDNs are smart enough not to cache error pages, but in order to
|
||||||
|
// make this hack work, we need to return the CSS file as a 200, which
|
||||||
|
// would otherwise be cached.)
|
||||||
headers['Content-Type'] = 'text/css; charset=utf-8';
|
headers['Content-Type'] = 'text/css; charset=utf-8';
|
||||||
|
headers['Cache-Control'] = 'no-cache';
|
||||||
res.writeHead(200, headers);
|
res.writeHead(200, headers);
|
||||||
res.write(".meteor-css-not-found-error { width: 0px;}");
|
res.write(".meteor-css-not-found-error { width: 0px;}");
|
||||||
res.end();
|
res.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user