TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-27-2008, 04:43 PM   #1 (permalink)
The Acquainted
Inquisitive 
 
Join Date: Jul 2005
Location: UK
Posts: 121
Thanks: 41
Brook is on a distinguished road
Default Do I need to worry about page caching?

Hi All, it seems I am a worrier.

On a large/busy site, would I need to worry about caching my pages? If say the pages were running around 25 queries in total? (Similar to talkphp's homepage but with more images.)

While I could prob easily cache the homepage and other top level pages to every ten mins or so, there would be hundreds of other pages that I wouldn't be able to cache so easily.

The server has memache installed (how effective is that anyway?).

Am I worrying over nothing? Or for a busy site should is caching essential?

Cheers,
__________________
PS3 Forums on GameSlurp - the site for gaming fans!
Brook is offline  
Reply With Quote
Old 01-27-2008, 05:31 PM   #2 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

That's quite a hard question to answer as it depends on your requests/second and whether your server can handle it

As a general guide, I personally would probably implement a caching system if the site where getting more than about 10 requests per second or less if the site was paticularly server-intensive.

As for memcache, I've never used it so I can't really comment. I have used APC though which I liked a lot - worked well.

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
The Following User Says Thank You to Alan @ CIT For This Useful Post:
Brook (01-27-2008)
Old 01-27-2008, 05:41 PM   #3 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

There are a number of levels of cache that you might want to think about implementing, each with their own particular advantages. I won't go through all of the different tiers but just highlight some. You could cache an entire rendered page and essentially serve it as static content, which would obviously be hugely beneficial but only if that's a usable situation -- eg. this is not possible if user-data ("Hello Salathe") is on the page.

You could cache particular portions of rendered HTML, maybe for sections that might be especially resource/time intensive but is pretty static (like lots of SQL queries for a sidebar, perhaps).

You could also cache database results meaning that for those cached queries/result-sets the time/memory needed to talk to the database and get back the results can be negated.

Another thing to ask, is caching really all that important a thing to implement right now for your application? Twenty-five well written queries isn't really such a terrible thing to worry about. But if you were worried then perhaps instead of, or along side, caching you could think about optimising and/or reducing the number of database queries.
Salathe is offline  
Reply With Quote
The Following 2 Users Say Thank You to Salathe For This Useful Post:
Brook (01-27-2008), danielneri (01-27-2008)
Old 01-27-2008, 06:53 PM   #4 (permalink)
The Acquainted
Inquisitive 
 
Join Date: Jul 2005
Location: UK
Posts: 121
Thanks: 41
Brook is on a distinguished road
Default

I think the homepage and other top level pages will be possible to get cached but there will be lots of off-shoot pages that won't.

The other option is to go with Drupal - which has a caching system built in.. but then I've heard that for logged in users it's pretyt much switched off anyway. Plus I dunno, most 'large' Drupal sites I know always seem fairly slow to load up
__________________
PS3 Forums on GameSlurp - the site for gaming fans!
Brook is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:10 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design