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.

This commit is contained in:
Nick Winter 2015-04-07 19:03:35 -07:00
parent f3c973b945
commit f02a8b54f3
4 changed files with 5 additions and 2 deletions

View file

@ -14,4 +14,4 @@
#poll-view #poll-view
min-height: 200px min-height: 200px
position: relative position: relative
z-index: 0

View file

@ -62,7 +62,7 @@ module.exports = class AnalyticsSubscriptionsView extends RootView
for subscriber in @subscribers for subscriber in @subscribers
subscriber.level = User.levelFromExp subscriber.user.points subscriber.level = User.levelFromExp subscriber.user.points
if hero = subscriber.user.heroConfig?.thangType 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?() @render?()
@supermodel.addRequestResource('get_subscribers', options, 0).load() @supermodel.addRequestResource('get_subscribers', options, 0).load()

View file

@ -199,6 +199,8 @@ exports.config =
sass: sass:
mode: 'ruby' mode: 'ruby'
allowCache: true allowCache: true
bless:
cacheBuster: false
modules: modules:
definition: (path, data) -> definition: (path, data) ->

View file

@ -213,6 +213,7 @@ module.exports = class Handler
return @sendDatabaseError(res, err) if err return @sendDatabaseError(res, err) if err
return @sendNotFoundError(res) unless document? return @sendNotFoundError(res) unless document?
return @sendForbiddenError(res) unless @hasAccessToDocument(req, 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)) @sendSuccess(res, @formatEntity(req, document))
getByRelationship: (req, res, args...) -> getByRelationship: (req, res, args...) ->