• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database caching confusion

Hi there folks.
Ive got a very serious problem. I cannot see a deferents between those snippets:




I'm really confused, are there many types of database caching? Or it is just redundant code? Explain it to me. Thank you!.

Manually enables caching.

This function must be called to begin caching. All Active Record queries of the correct type (see below for supported queries) are stored for later use.

So where is the different?
Both enable/disable caching. I can't see the point.
With one I suppose to use? It seems pointless.

Sorry I left a huge chunk out when I copied and pasted before

Active Record Caching

While not "true" caching, Active Record enables you to save (or "cache") certain parts of your queries for reuse at a later point in your script's execution. Normally, when an Active Record call is completed, all stored information is reset for the next call. With caching, you can prevent this reset, and reuse information easily.

Cached calls are cumulative. If you make 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:

I assume then $this->db->cache_on(); is for active records, if both functions work then don't stress about it an just use $this->db->cache_on()

Oh, alright, separated cache switch for database with and without active record. This make some sense.

has no effect when active records is ON.

This is very poorly designed.

start_cache() is queries cache.
cache_on() is result cache.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.