Re: [PHP] PHP+MySQL website cache ? Yes/No



Hi,

If you able to access memcached. Use memcached.
Put your shopping chart items, rendered html items in memcached.

It was MUCH faster solution...

Regards

Sancar

On Sunday 25 February 2007 13:59, Martin Zvarík wrote:
This benchmark is not very accurate, but you are right the database
connection took most of the time.

Shopping cart is stored in session - not in database.

I am half-way doing the eshop I bet it will took much more than 0.01 sec
to generate the final version.

I was going to make this file cache system, but I relies that for each
page like (?page=News, ?page=Products etc.) these HTML blocks
(Navigation, Recommended) changes and that would mean I would have
eventually like 50+ cached files.

One way or another I will always need to connect do database (I cannot
cache 300 products in 300 files, can I?). So I decided to put the cache
in database table - For each URL Name (news/, products/ etc) a Cache
(which will be an array of all HTML blocks).

Martin

lists@xxxxxxxxxxx napsal(a):
Quoting Martin Zvarík <mzvarik@xxxxxxxxx>:
I did a benchmark with and without caching to HTML file and it's like:

0.0031 sec (with) and 0.0160 sec (with database)

I know these miliseconds don't matter, but it will have significant
contribution in high-traffic website, won't it?

Martin

--PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Yes it will. And the 0.0129 seconds extra most of it is maybe to create
the DB connection. Or are you using a persistent connection and reuseing
it?

This benchmark was that together with all other content of the page? I
mean including your dynamic shopping cart etc?

/Peter

--PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.



Relevant Pages