[eluser]sn4k3[/eluser]
[quote author="richthegeek" date="1263706778"]Actually yes, with regards to your caching.
Caching is only worth it at a large number of hits, cos of maths...
uncached = time to execute * number of hits
cached = (time to execute * time to write to file) + (time to read cache * number of hits)
time to execute = SQL exec time + PHP exec time
In the uncached one if your SQL exec time is low compared to the overall exec time, then it's worth caching the output.
In the cached one, you will be dealing with the relative slowness of your disk - it can take half a second to write a file on a filesystem under strain, and about 1/100th to read, especially repeatedly due to the file being memcached.
Basically, doing it every second means you are spending more time arranging the cache than you are saving from caching.
You can do your cron job every second to automatically end auctions, and stop users from placing bids on auctions that have just ended, but the actual output can be cached every 30 sections, minute, whatever.
All the same, you'd probably get more benefit out of using memcached (stores the compiled PHP for execution, cutting per-page load times) or other exec-time reducing technologies.[/quote]
i see, so what you recommend for such thing, it must do that jobs every second, i have no other way
also can you recommend me an cache library for i use with other stuff
Thanks