What solution i should use for caching

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

What solution i should use for caching

Post by fabby »

Hi all.
I hava a problem with a site. Is veri big, has a lot of requests to the database, and i am forced to use caching.
What should i do? to cache a page, linke on this url: articles.sitepoint.com/article/caching-php-performance/3 or to use some classe, like smart class, or memcache, etc.? What solution is more faster?

Thanks
I will wait your opinion!
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: What solution i should use for caching

Post by Darhazer »

How big it is? How many requests to the database? Maybe you have bad db design / queries, and not need of cache. Always check your slow query log :)
As for the caching, use memcached.
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Re: What solution i should use for caching

Post by fabby »

but what about the solution that i gave as an example? is not faster?
(the site has many queryes, and about 200 mb of data ).
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: What solution i should use for caching

Post by Darhazer »

fabby wrote:but what about the solution that i gave as an example? is not faster?
(the site has many queryes, and about 200 mb of data ).
200 mb of data is pretty small database actually. How many requests?
Did you look at the slow log?

as for the caching, you may cache the entire cache, but since some things are shared it may be more efficient to cache different parts of the page, and when you load the page, to retrieve all of them from the cache.

But... maybe you are still not forced to use cache. We are working on tables with millions of records and 300 queries per second load :) So, 200 mb data and few thousand queries for a whole day is not big.
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Re: What solution i should use for caching

Post by fabby »

But the solution that i gave you as an example is ok?
I tried to use smart cache, but when i am using for categories.php that shows the categoryes, appear problems and the site crashes.

(after i know what solution is better, then i will ask you about optimization...to see what is best for the site)
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Re: What solution i should use for caching

Post by fabby »

so nobody can help me? :(
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: What solution i should use for caching

Post by Darhazer »

fabby wrote:so nobody can help me? :(
Well, you need to help yourself first.
Post Reply