From f02a8b54f3db0a8aff03990668efeaa97a50e387 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 7 Apr 2015 19:03:35 -0700 Subject: [PATCH] Fixed #2596. Stopped bless-brunch from using its cacheBuster feature. Set no-cache header for /db/model.type/slug so that we can use Cloudflare on /db/model.type/object-id. Fixed a coffeelint warning. --- app/styles/editor/poll/poll-edit-view.sass | 2 +- app/views/admin/AnalyticsSubscriptionsView.coffee | 2 +- config.coffee | 2 ++ server/commons/Handler.coffee | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/styles/editor/poll/poll-edit-view.sass b/app/styles/editor/poll/poll-edit-view.sass index 72f13a11c..c76880a62 100644 --- a/app/styles/editor/poll/poll-edit-view.sass +++ b/app/styles/editor/poll/poll-edit-view.sass @@ -14,4 +14,4 @@ #poll-view min-height: 200px position: relative - + z-index: 0 diff --git a/app/views/admin/AnalyticsSubscriptionsView.coffee b/app/views/admin/AnalyticsSubscriptionsView.coffee index 9a86ab724..1b54aeb21 100644 --- a/app/views/admin/AnalyticsSubscriptionsView.coffee +++ b/app/views/admin/AnalyticsSubscriptionsView.coffee @@ -62,7 +62,7 @@ module.exports = class AnalyticsSubscriptionsView extends RootView for subscriber in @subscribers subscriber.level = User.levelFromExp subscriber.user.points if hero = subscriber.user.heroConfig?.thangType - subscriber.hero = slug for slug, original of ThangType.heroes when original is hero + subscriber.hero = _.invert(ThangType.heroes)[hero] @render?() @supermodel.addRequestResource('get_subscribers', options, 0).load() diff --git a/config.coffee b/config.coffee index e426a7aec..03d7b4a1e 100644 --- a/config.coffee +++ b/config.coffee @@ -199,6 +199,8 @@ exports.config = sass: mode: 'ruby' allowCache: true + bless: + cacheBuster: false modules: definition: (path, data) -> diff --git a/server/commons/Handler.coffee b/server/commons/Handler.coffee index 44f459518..08bb9c2b9 100644 --- a/server/commons/Handler.coffee +++ b/server/commons/Handler.coffee @@ -213,6 +213,7 @@ module.exports = class Handler return @sendDatabaseError(res, err) if err return @sendNotFoundError(res) unless document? return @sendForbiddenError(res) unless @hasAccessToDocument(req, document) + res.setHeader 'Cache-Control', 'no-cache' unless Handler.isID(id + '') # Don't cache if it's a slug instead of an ID @sendSuccess(res, @formatEntity(req, document)) getByRelationship: (req, res, args...) ->