Jump to content

Need some PHP Server Side Caching Advice


danielholmes85

Recommended Posts

Hi everyone,

 

I need some advice from some PHP gurus about server side caching. The site I'm currently developing has stats of approximately 1,000,000 hits per month. It will be running on a VPS LAMP setup (PHP 5, not sure of MySQL version yet). My first question was:

 

1) Do I even need server side caching? From my research so far i think it seems pretty necessary, but am keen to get opinions on how necessary is server side caching for the site. I can't find recommendations on exact stats about when it's needed. I realise it's probably a bit too much of a fuzzy area to provide precise stats too, so any advice, general or specific would be much appreciated.

 

2) With the cached version of the page, would it be better to store this in a table or in a text file and what are the trade offs? The database would be quicker, but would it be better for me to remove as much strain as possible from the database by using text files?

 

As some background to the architecture, im planning on using a content sensitive caching rule, with the cache being updated as changes are made in the CMS using Smarty templates. I've heard Smarty can suffer under big loads but this won't come into play because CMS updates will be fairly sparce.

 

Having not undertaken a project this size before any advice around this area would be greatly appreciated.

 

Thanks in advance gurus,

 

Daniel

Link to comment
Share on other sites

1/ If as you say 'CMS updates will be fairly sparce' then yes, caching is probably a good idea.

 

2/ I'm no expert, but all caching systems Ive seen store on the filesystem. If you look at something like code igniter's application flow (seen here) you can see that caching can also save on allot of application logic because if a document is found in the cache it is served almost straight away. However, I would think removing strain from the database server would also be of benifit.

 

Hope this helps, even just a little.

Link to comment
Share on other sites

Brilliant! Thanks a heap thorpe - I'll definitely use the file system then (I've been looking into PEAR Cache_Lite). I looked at CodeIgniter and Symfony before starting but haven't used a framework before, so thought it best to go it alone this time. But that diagram was great, makes you realise just how benefitial server side caching is

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.