UPDATE: the complete explanation is now published at Midware Core Concepts » Caching Pages
______________________
Cache is a very nice feature, which serves pregenerated html files, makes pages load lightning fast, does not call any tags and mysql. Basically, serving a static page.
Cache can be enabled/disabled in /couch/config.php
I'm quoting @KK here below with even more details about caching. It might save a lengthy answer in future. I personally found something new in it.
______________________
Basically Couch employs a very simple kind of caching strategy.
Following is some pseudo-code of the process -
I think that should give you an over-all view of the process.
______________________
Cache is a very nice feature, which serves pregenerated html files, makes pages load lightning fast, does not call any tags and mysql. Basically, serving a static page.
Cache can be enabled/disabled in /couch/config.php
define( 'K_USE_CACHE', 1 );
I'm quoting @KK here below with even more details about caching. It might save a lengthy answer in future. I personally found something new in it.
______________________
Basically Couch employs a very simple kind of caching strategy.
Following is some pseudo-code of the process -
- Code: Select all
if( caching is on ){
if( user is not logged-in AND has explicitly not asked to bypass cache){ // by appending 'nc=1' to the URL the cache can be bypassed
if( the current URL is in cache ){ // a file with the name of the current URL's MD5 hash is searched in cache
if( the cache has not been busted ){ // any 'save' has not been done to *any* page after this file was cached
return this cached file // execution ends here
}
}
}
}
//if we are here, either the user was logged in, or an unlogged user had used 'nc=1' or the current URL was not in cache ..
// process request normally (i.e. parse template and send back whatever was outputted)
output = parse_template() // i.e run all Couch tags to get the final output
if( caching is on ){
if( <cms:no_cache /> was not found anywhere in the template just parsed ){
cache_output() // save it as a file named with the MD5 of the current URL
}
}
return output // end of execution
I think that should give you an over-all view of the process.