php-fig/fig-standards — pull request #140 by tedivm (2013-06-05 06:41:18+00:00)
Title: [WIP] Cache Proposal

## Purpose

This caching proposal attempts to define a common interface for basic caching functions, allowing better interoperability amongst frameworks and libraries. The proposal has been over a year in the making, with many contributions both in the repository itself and from the group mailing list.

## Considerations

It was deemed by the group as a whole that this first proposal would be as simple as possible, while allowing for advanced functionality to be defined in follow up proposals. Some features have been left out or removed from this proposal to satisfy that. For example, grouping functionality- such as namespaces, tags and stacks- are being excluded in order to speed up passing this proposal, as there is still a lot of discussion and thought that needs to occur around them.

## Remaining Steps

There are still a few items that need to be decided by the group before this proposal can be considered ready for a vote-

* **Strong versus Weak Item Object**- This is probably the largest item to be decided. The existing proposal treats Items as first class objects, putting all of the individual item functionality under it's responsibility. It has also been proposed that this Item class only be treated as a simple value wrapper.

* **Naming Conventions**- Some of the class and function names may be made more clear if they are changed.

* **TTL Strength**- There is still discussion about whether the TTL should be a required value, as not all caching libraries support this method of invalidation. The exact mechanisms of how a TTL would be used still needs to be finalized by the group.

* **Key Definitions**- There have been discussion of lowering the restrictions on what a key looks like.

* **DateTime for Expiration**- The current proposal allows a DateTime object to be used to define the expiration time of a cached Item, but there have been proposals to remove this for clarity sake.

* **Inc/Dec Functions**- It has been proposed on the list that functions to expose increment and decrement functionality should be added.

This list will be updated with links as Pull Requests are made against this proposal with specific wording for each of these issues. In other words, **please issue PRs against this policy with any changes you'd wish to make.**