Class: Rack::Cache::Request

### Home Classes Methods

### In Files

- lib/rack/cache/request.rb

### Parent

Rack::Request

### Methods

- #cache_control
- #no_cache?
- #request_method

### Files

- CHANGES
- COPYING
- README
- TODO

### Class/Module Index

Quicksearch

- Rack
- Rack::Cache
- Rack::Cache::AppEngine
- Rack::Cache::AppEngine::MC
- Rack::Cache::AppEngine::MemCache
- Rack::Cache::CacheControl
- Rack::Cache::Context
- Rack::Cache::EntityStore
- Rack::Cache::EntityStore::DISK
- Rack::Cache::EntityStore::Dalli
- Rack::Cache::EntityStore::Disk
- Rack::Cache::EntityStore::FILE
- Rack::Cache::EntityStore::GAE
- Rack::Cache::EntityStore::GAECACHE
- Rack::Cache::EntityStore::GAEStore
- Rack::Cache::EntityStore::HEAP
- Rack::Cache::EntityStore::Heap
- Rack::Cache::EntityStore::MEM
- Rack::Cache::EntityStore::MemCacheBase
- Rack::Cache::EntityStore::MemCached
- Rack::Cache::Key
- Rack::Cache::MetaStore
- Rack::Cache::MetaStore::DISK
- Rack::Cache::MetaStore::Dalli
- Rack::Cache::MetaStore::Disk
- Rack::Cache::MetaStore::FILE
- Rack::Cache::MetaStore::GAE
- Rack::Cache::MetaStore::GAECACHE
- Rack::Cache::MetaStore::GAEStore
- Rack::Cache::MetaStore::HEAP
- Rack::Cache::MetaStore::Heap
- Rack::Cache::MetaStore::MEM
- Rack::Cache::MetaStore::MemCacheBase
- Rack::Cache::MetaStore::MemCached
- Rack::Cache::Options
- Rack::Cache::Request
- Rack::Cache::Response
- Rack::Cache::Storage

No matching classes.

# Rack::Cache::Request

Provides access to the HTTP request. The `request` and `original_request` objects exposed by the Core caching engine are instances of this class.

Request objects respond to a variety of convenience methods, including everything defined by Rack::Request as well as the Headers and RequestHeaders modules.

### Public Instance Methods

cache_control() click to toggle source

A CacheControl instance based on the request's Cache-Control header.

    # File lib/rack/cache/request.rb, line 22
    def cache_control
      @cache_control ||= CacheControl.new(env['HTTP_CACHE_CONTROL'])
    end

no_cache?() click to toggle source

True when the Cache-Control/no-cache directive is present or the Pragma header is set to no-cache.

    # File lib/rack/cache/request.rb, line 28
    def no_cache?
      cache_control['no-cache'] ||
        env['HTTP_PRAGMA'] == 'no-cache'
    end

request_method() click to toggle source

The HTTP request method. This is the standard implementation of this method but is respecified here due to libraries that attempt to modify the behavior to respect POST tunnel method specifiers. We always want the real request method.

    # File lib/rack/cache/request.rb, line 17
    def request_method
      @env['REQUEST_METHOD']
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.