I'm developing a site in PHP which has some complex SQL queries and I would like to implement a caching feature to reduce the load on the database.
I'm just wondering would it be better to write and read HTML directly to a file or perhaps create something like a YAML file with a delimiter to separate records then wrap it in HTML with a function?
My thinking is that this would allow user options (for example, number of records to display) to be applied to the request.
Any advice / suggestions appreciated.
Thanks.
I came to the conclusion that, by default, php files are never EVER pulled from cache, even in mobile browsers, even if in the response there is no Cache-Control nor Expires parameter, even if i don't send POST requests and i just follow a link to the page. They are always redownloaded.
Caching Data is a process that stores multiple copies of data or files in a temporary storage location—or cache—so they can be accessed faster.
A cache's primary purpose is to increase data retrieval performance by reducing the need to access the underlying slower storage layer. Trading off capacity for speed, a cache typically stores a subset of data transiently, in contrast to databases whose data is usually complete and durable.
Use any of these for caching backends:
and use Zend_Cache for a unified interface to them
Whether to use full page caching or partial caching depends on your specific UseCases. Usually, your application will have a mix of both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With