Monkuar Posted April 3, 2012 Share Posted April 3, 2012 let's say I have 100,000 users on my forum i want to cache there PROFILE INFO (About me) in .php files which is easy/etc but would that be more space than 100k rows in a db table, or 100k .php files? just wondering, prob a stupid question but atm I cache some lottery info and some other stuff, but that's only 1 .php it would be dumb to cache info and have 100k .php's for each user ID right? or maybe story it all in 1 .php? would be a HUGE Filesize? rather just keep the data in MYSQL right? Quote Link to comment https://forums.phpfreaks.com/topic/260300-caching-info/ Share on other sites More sharing options...
marklarah Posted April 4, 2012 Share Posted April 4, 2012 Absolutely, you should keep it in MySQL, storing it in PHP files is extremely counterintuitive (and will be slow when you try to execute it and take up memory). Your best bet is to use memcached I think. Quote Link to comment https://forums.phpfreaks.com/topic/260300-caching-info/#findComment-1334193 Share on other sites More sharing options...
scootstah Posted April 4, 2012 Share Posted April 4, 2012 You don't need to cache something that isn't accessed. The general idea of caching is that when it is requested, you store it in a cache. Subsequent requests will pull from the cache until it expires, in which case it will be re-cached. If nobody ever visits Jane Doe's profile, it will never be cached. Only those that are accessed will be cached. Though if you are caching to the disk to avoid a few queries then you probably won't see any real benefit. Quote Link to comment https://forums.phpfreaks.com/topic/260300-caching-info/#findComment-1334204 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.