Ticket #322 (closed defect: fixed)

Opened 17 years ago

Last modified 16 years ago

Controller cache API is missing

Reported by: Elliot Sprehn Owned by: boomfish
Priority: normal Milestone: 3.1 Maintenance Final
Version: 3.0.178 Severity: major
Keywords: Cc:

Description

Originally posted by Elliot Sprehn on 5/17/2008 at 1:42 AM: entered by Ezra Parker on port to new system

The cache API from the modelglue.unity.controller.Controller is missing.

These functions are:

AddToCache()
ExistsInCache()
GetFromCache()
RemoveFromCache()

I was thinking that if these are implemented as part of the content cache then it should probably be documented that a prefix of "modelglue." on the key is appended, plus the controller name since the cache was separate for each controller?

Although, I could see wanting objects (ex. queries) to be cached by default for X amount of time and content cached with a different timeout. Would it be possible to just leave the old modelglue.util.TimedCache and defaultCacheTimeout?

Thanks.

Change History

Changed 16 years ago by DanWilson

  • milestone changed from 3.0 Public Beta 1 to 3.2

Changed 16 years ago by DanWilson

  • milestone changed from 3.2 to 3.1.x-next-patch

Changed 16 years ago by DanWilson

  • status changed from new to assigned

Changed 16 years ago by boomfish

  • milestone changed from 3.1 Maintenance Beta to 3.1 Maintenance Final

Pushed ticket to next milestone. We may consider pushing this to the 3.2 release.

Changed 16 years ago by boomfish

  • owner changed from DanWilson to boomfish
  • status changed from assigned to new

I've implemented the missing methods in my working copy according to the documentation in the Wiki. However while testing the methods I discovered a number of problems with Gesture's cache adapter.

I should have a solution ready in the next 24 hours, but it is likely to involve significant changes (fixes) to the cache adapter. If you'd rather I not commit such changes directly to SVN let me know and I'll post a patch instead.

The new methods use a cache prefix of "value." without the controller name. I did not see anything in the documentation that suggests that each controller should have its own cache. If a controller wants to keep its cached values separate it can add its own prefix.

I see the point about allowing the default timeout for values and content to be different. We'll look at that as part of the plan for a broader approach to caching that we hope to have ready for the 3.2 release.

Changed 16 years ago by boomfish

  • status changed from new to assigned

Changed 16 years ago by boomfish

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in SVN revision 278.

I also fixed a few other caching bugs, the biggest one preventing the cache adapter from expiring elements properly. To help make sure that I got the cache adapter fixes right, I expanded the code in TestSimpleTimedCache.cfc almost sixfold. TDD FTW!

Note: See TracTickets for help on using tickets.