Welcome to WebmasterWorld Guest from 54.167.85.221

Forum Moderators: open

Message Too Old, No Replies

Which is faster? DB or file caching?

     

smithaa02

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

10+ Year Member



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?

Demaestro

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

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

smithaa02

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

10+ Year Member



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?

Demaestro

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

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month