Sha256: 1eb08a4e95250ec477f639e9ff829f80f295b20f4acc2e7e478e4ebc29a81009

Contents?: true

Size: 811 Bytes

Versions: 17

Compression:

Stored size: 811 Bytes

Contents

# *Flexirest:* Caching

Expires and ETag based caching is enabled by default, but with a simple line in the application.rb/production.rb you can disable it:

```ruby
Flexirest::Base.perform_caching = false
```

or you can disable it per classes with:

```ruby
class Person < Flexirest::Base
  perform_caching false
end
```

or per request endpoint with:

```ruby
class Person < Flexirest::Base
    get :all, "/people", skip_caching: true
end
```

If Rails is defined, it will default to using Rails.cache as the cache store, if not, you'll need to configure one with a `ActiveSupport::Cache::Store` compatible object using:

```ruby
Flexirest::Base.cache_store = Redis::Store.new("redis://localhost:6379/0/cache")
```


-----

[< Combined example](combined-example.md) | [Using callbacks >](using-callbacks.md)

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
flexirest-1.12.4 docs/caching.md
flexirest-1.12.3 docs/caching.md
flexirest-1.12.2 docs/caching.md
flexirest-1.12.1 docs/caching.md
flexirest-1.12.0 docs/caching.md
flexirest-1.11.3 docs/caching.md
flexirest-1.11.2 docs/caching.md
flexirest-1.11.1 docs/caching.md
flexirest-1.11.0 docs/caching.md
flexirest-1.10.12 docs/caching.md
flexirest-1.10.11 docs/caching.md
flexirest-1.10.10 docs/caching.md
flexirest-1.10.9 docs/caching.md
flexirest-1.10.8 docs/caching.md
flexirest-1.10.7 docs/caching.md
flexirest-1.10.6 docs/caching.md
flexirest-1.10.5 docs/caching.md