0

Is it possible to disable automatic etag header generation in rails for a specific action?

I tried to set response.etag = nil in the action, in an after_filter and in a before_filter. None of them have worked.

Fernando
  • 4,459
  • 4
  • 26
  • 39

1 Answers1

2

E-tags are generated by Rack middleware. You should be able to skip e-tag generation by setting a cache control header in the response.

This can be done by calling expires_now in your controller action to skip caching in Rack and any other servers that handle your request.

Here is a reference from Heroku that is applicable to Rails apps in general.

John Naegle
  • 8,077
  • 3
  • 38
  • 47