coen-hyde/Shanty-Mongo — Issue #67: Caching layer in queries
Author: quard8
Created: 2012-02-19 19:05:08+00:00
State: open

I'm thinking about caching layer which should be simple and don't break current behaviour of constructing queryies.

Ideal solution is to add cache() function in query chain, like this:
```php
$users = User::all()->cache($key, $time)->limit(5);
```
the problem is that function all() returns MongoCursor object, and we can't handle sort() and limit(), because cache data will be invalid.

Currently I can't imagine how to implement this. Maybe add some abstraction layer behind MongoCursor, or something different.

Any suggestions?