Welcome Guest, Not a member yet? Register   Sign In
Caching Functions
#11

[eluser]gRoberts[/eluser]
All you need to do is store the value in either a database or memcache. If the date since you last got the hostname is longer then say 5/10 minutes, get it again otherwise return back the value from the database/memcache.

I'm using memcache to serve 95% of my data. Basically I have functions that check to see whether there is data. If so, it gets it, otherwise it queries the database, caches the result and returns the results.

When ever anything is changed, the related cache is updated.


Messages In This Thread
Caching Functions - by El Forum - 09-08-2008, 10:32 AM
Caching Functions - by El Forum - 09-09-2008, 09:10 AM
Caching Functions - by El Forum - 09-09-2008, 09:38 AM
Caching Functions - by El Forum - 09-09-2008, 09:41 AM
Caching Functions - by El Forum - 09-09-2008, 10:49 AM
Caching Functions - by El Forum - 09-09-2008, 10:57 AM
Caching Functions - by El Forum - 09-09-2008, 11:14 AM
Caching Functions - by El Forum - 09-09-2008, 03:17 PM
Caching Functions - by El Forum - 09-09-2008, 08:30 PM
Caching Functions - by El Forum - 09-09-2008, 10:55 PM
Caching Functions - by El Forum - 09-10-2008, 09:01 AM
Caching Functions - by El Forum - 09-10-2008, 09:24 AM
Caching Functions - by El Forum - 09-10-2008, 09:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB