Class ActiveSupport::Cache::Entry
In: lib/active_support/cache.rb
Parent: Object

Entry that is put into caches. It supports expiration time on entries and can compress values to save space in the cache.

Methods

compressed?   create   expired?   expires_at   expires_at=   new   raw_value   size   value  

Constants

DEFAULT_COMPRESS_LIMIT = 16.kilobytes

Attributes

created_at  [R] 
expires_in  [R] 

Public Class methods

Create an entry with internal attributes set. This method is intended to be used by implementations that store cache entries in a native format instead of as serialized Ruby objects.

Create a new cache entry for the specified value. Options supported are +:compress+, +:compress_threshold+, and +:expires_in+.

Public Instance methods

Check if the entry is expired. The expires_in parameter can override the value set when the entry was created.

Seconds since the epoch when the entry will expire.

Set a new time when the entry will expire.

Get the raw value. This value may be serialized and compressed.

Returns the size of the cached value. This could be less than value.size if the data is compressed.

Get the value stored in the cache.

[Validate]