Hi,
I read stuff about memcache at http://www.danga.com/memcached/
and this look really good right...basically if you show some stats or something like stats.php?id=5 you cache this...and all users use the cache at same time...doing sql query once actually...
Only question is how do you tell memcache to update the cache... any tips and tricks on that...are you doing like refresh on each INSERT/UPDATE/DELETE on data that concerns the memcached thing?
memcache - when good to use
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
You can invalidate the cache upon UPDATE/DELETE. Inserting records isn't really a problem, because there is no record in cache to invalidate.
Another way is to have a TTL (time to live) saved with each cache entry and requery the database every once in a while. This means the cache will contain some stale records at a given time but for many cases this isn't really a problem.
regards
Another way is to have a TTL (time to live) saved with each cache entry and requery the database every once in a while. This means the cache will contain some stale records at a given time but for many cases this isn't really a problem.
regards