Patch #2387

Kohana::cache() doesn't use lifetime

Added by Ivan Brotkin about 2 years ago. Updated about 2 years ago.

Status:Closed Start date:11/27/2009
Priority:High Due date:
Assignee:Woody Gilk % Done:

0%

Category:Core
Target version:v3.0.4
Resolution:invalid Points:

Description

Here is my patch for this feature.

core.diff (916 Bytes) Ivan Brotkin, 11/27/2009 12:49 pm

History

Updated by Woody Gilk about 2 years ago

  • Status changed from New to Closed
  • Target version changed from v3.0.3 to v3.0.4
  • Resolution set to invalid

Lifetime is not stored with the cache, it is checked via filemtime.

Updated by Ivan Brotkin about 2 years ago

So, I need set $lifetime every time I want to load data from cache? With my patch lifetime set only once (when saving) and then use Kohana::cache($name), without any special settings. Why getter should know cache lifetime?

Updated by Woody Gilk about 2 years ago

So, I need set $lifetime every time I want to load data from cache?

Yes.

Updated by Ivan Brotkin about 2 years ago

Is it good decision? Cookies (for example) use $expiration when saving instead of getting...

Updated by Woody Gilk about 2 years ago

Cookies support an expiration date directly, files do not.

Updated by Ivan Brotkin about 2 years ago

Well, I always thought that its easier to set lifetime once, and then only compare file timestamp with lifetime stored... Ok, let it be as is.

Also available in: Atom PDF