Pass in developer mode, manage caches.

The different caches

There is a total of four caches managed by Cendre. Three server-side and one client side.

Server-side (managed by the configuration file) :

The execution cache for dynamic pages.
The memory cache for small static files.
The template cache for template files.

Client-side :

The HTTP cache for static files (managed by the configuration file) and dynamic pages (manual management).

The memory cache keeps all files metadatas, and small files content up to exports.upload.read_size KB in RAM.
The template cache keeps all template files content in RAM. Be sure to keep this setting enabled in production as it's a synchronous call.

Disable all caches

In your configuration file, add the following lines with the right hostname :

exports.hostname = 'localhost';
// Creating default configuration for the www folder.
exports.host = require('../base.nodejs')();
// Enable developer mode (no cache).
exports.host.cache[0].action = 0;				// HTTP cache for static files.
exports.host.exec.cache = false;				// Execution cache.
exports.host.memory = false;					// Memory cache.
exports.host.modules.template.cache = false;	// Template cache.
// Set the www folder.
exports.host.root = '/var/www';

In your dynamic pages, add the following line to force the browser to refresh its cache at each request :

exports.mimetype = 'text/html';
exports.encoding = 'utf-8';

exports.run = function(c, end)
{
	// HTTP cache for dynamic pages. Disable browser caching.
	c.server_response.setHeader('Cache-Control', 'no-cache, must-revalidate');
};

In order to force the cache to refresh after 5 minutes :

c.server_response.setHeader('Cache-Control', 'max-age=300, private');

And for deleting the cache policy :

c.server_response.removeHeader('Cache-Control');