n8 / bust_rails_etags Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
We want to be able to turn off etags in dev env, but removing ConditionalGet or Etag from the Rack stack does not do it. As this issue points out (rails/rails#3583) they don't consider a feature they should support.
I felt the next best thing was to put this feature in this gem. I forked it and tried implementing it but couldn't get user initializers running before this gem gets inserted into the stack.
What are your thoughts on being able to disable etags in dev environment?
Hi @n8,
thank you for the idea to take the heroku version into account.
I came up with a slightly improved API call, which just returns the current release and not all of them.
ENV['ETAG_VERSION_ID'] =
Heroku::API.new(api_key: Figaro.env.heroku_api_key)
.get_release(Figaro.env.heroku_app, :current)
.body['name']
I also want to note, that this gem might be obsolete with Rails 4.
Rails 4 introduced controller-wide ETags.
class ApplicationController < ActionController::Base
etag { ENV['ETAG_VERSION_ID'] }
# ...
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.