---
name: "CHI::CacheObject"
section: "3pm"
platform: "linux"
package: "libchi-perl"
version: "0.61-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/CHI::CacheObject"
---

# CHI::CacheObject(3pm)

Contains information about cache entries

## NAME

CHI::CacheObject - Contains information about cache entries

## VERSION

version 0.61

## SYNOPSIS

```
    my $object = $cache->get_object($key);

    my $key        = $object->key();
    my $value      = $object->value();
    my $expires_at = $object->expires_at();
    my $created_at = $object->created_at();
    if ($object->is_expired()) { ... }
```

## DESCRIPTION

The CHI method returns this object if the key exists.  The object will be returned even if the entry has expired, as long as it has not been removed.

There is currently no public API for creating one of these objects directly.

## METHODS

All methods are read-only. The get\_\* methods are provided for backward compatibility with Cache::Cache's Cache::Object.

- key

  The key.

- value

  The value.

- expires\_at

  - get\_expires\_at

  Epoch time at which item expires.

- created\_at

  - get\_created\_at

  Epoch time at which item was last written to.

- is\_expired

  Returns boolean indicating whether item has expired. This may be probabilistically determined if an "expires\_variance" was used.

## SEE ALSO

CHI

## AUTHOR

Jonathan Swartz \<swartz@pobox.com\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Jonathan Swartz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
