Re: using APC as content-cache?
| From: | Rasmus Lerdorf | Date: | Fri, 29 Apr 2005 16:39:26 +0000 |
| Subject: | Re: using APC as content-cache? | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2324@lists.php.net to get a copy of this message | ||
Andreas Korthaus wrote:
I think today memory is not very expensive anymore (of course it depends on your application), so it would be possible to store a compressed and/or uncompressed versions in memory (and/or on disk if you want). You also could send caching HTTP-Headers to completely avoid requests.Memory may not be expensive, but you are still limited by the amount of shared memory your OS lets you allocate. You can throw 8 Gigs of memory in a server without too much trouble, but if you are on a 32-bit OS it won't help you.
I need something in the webserver (an own module?)Sounds like it. Writing a simple little Apache module is really not very hard. I have written dozens of custom modules for stuff like this. Although I guess I don't see why you can't just do the check in PHP and then readfile() the statically generated content after the check.
Using an opcode-cache as content-cache is not the fastest solution, but it's flexible and simple (eAccelerator is more flexible at the moment, see its API above), and does not require writing a webserver-module in C ;-)Sure, but I doubt it will ever correctly support PHP5. APC will soon. I suppose once I release the PHP5 version of APC the eAccelerator folks may be bright enough to clone it correctly. We will see. -Rasmus