homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

Which is faster? DB or file caching?

 9:28 pm on Jul 22, 2010 (gmt 0)

I'm working on a huge directory site with lots of dynamic content running some heavy duty sql statements on each page.

So I'm thinking I'll have to do some sort of caching on a scheduled basis. I would either generate a db cache where say each row value contains all html for the page or I would create a cache directory that would include prepped html files ready to be php included.

Any opinions?



 9:38 pm on Jul 22, 2010 (gmt 0)

I would look at turning on query caching.

I'm not sure what DB you are using but most have built in query caching. Basically it knows the result of a query and it knows if a table that a query retrieves info from has been updated. If it hasn't then instead of executing the query it just returns the cached results.

It works quite well. I have seen turning it on result in great performance enhancements for sites performing lots of DB hits per page load.

This is by far the easiest way to start if your DB has this built in.


 1:41 pm on Jul 23, 2010 (gmt 0)

Thanks for the information...I didn't know that. How scalable is query caching? I would probably have a 1000+ pages with significant content...is this something query caching could handle or would I have to tweak the settings to allow each page to be cached?


 4:19 pm on Jul 23, 2010 (gmt 0)

It doesn't matter how many pages there are. If you are worried about load it has more to do with how many times a table is updated while lots of queries are being executed.

Do a search for the name of your database and version and the words 'query caching'. Try to find something from the actual manual and read up on it.

As always with any change of this size I recommend creating a copy of the database and the site and make the changes and do your tweaking there... then once you are feeling safe switch it to the live site.

If you have more questions post back.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved