method
must_understand
v8.1.1 -
Show latest stable
- Class:
ActionController::ConditionalGet
must_understand()public
Adds the `must-understand` directive to the `Cache-Control` header, which indicates that a cache MUST understand the semantics of the response status code that has been received, or discard the response.
This is particularly useful when returning responses with new or uncommon status codes that might not be properly interpreted by older caches.
#### Example
def show @article = Article.find(params[:id]) if @article.early_access? must_understand render status: 203 # Non-Authoritative Information else fresh_when @article end end