Why does the following (in development mode) incorrectly return "304 not changed" - shouldn't such functions be disabled by default in Rails when starting in development mode?
My controller is as follows:
class WidgetController < ApplicationController def show @widget = Widget.find(params[:id]) fresh_when(etag: etag_for(@widget), last_modified: @widget.updated_at) end private def etag_for(*args) args.flatten + [current_user, last_deploy] end def last_deploy `git log --pretty=format:%H`.chomp end end
I donβt understand why in Development mode in my Rails application this will return β304 Not Modifiedβ headers, I thought that in accordance with the development mode such things were not included?
I am using a thin web server locally, which I suppose is a little unusual, otherwise it is a typical application without special conditions or cases running on Rails 3.1.1
source share