danielholmes85 Posted November 22, 2007 Share Posted November 22, 2007 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 Quote Link to comment Share on other sites More sharing options...
trq Posted November 22, 2007 Share Posted November 22, 2007 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. Quote Link to comment Share on other sites More sharing options...
danielholmes85 Posted November 22, 2007 Author Share Posted November 22, 2007 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 Quote Link to comment Share on other sites More sharing options...
trq Posted November 22, 2007 Share Posted November 22, 2007 Yeah, I didn't mean for you to actually use code igniter, but even that simple diagram describes allot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.