Mention the addition of new rules for ezjscore's generated CSS as an example of a custom rule
Example on the next page
Explain the « static » / « dynamic » thing: Most cluster methods can be used in two ways: - by instanciating the handler with the file's path and using the xxx() methods - or « statically » by calling fileXxx( 'path' ) on an empty instance It is usually more efficient to load the file in a handler if multiple sequential operations will be performed on it.
The 3 rd parameter of storeContents() / 4 th parameter of fileStoreContents() will be used by the cluster index as the file's Content-Type. It is critical for files that will be made available over HTTP. This is one of the issues that was actually affecting ezjscore back a few weeks ago.
View purpose: display the 'value' view parameter using a template. The generation logic is moved to the generate callback and doesn't belong to the view processCache parameters: - two callbacks: retrieve and generate - the null parameters are ttl and expiry. Not covered here. - an array of custom parameters received by both handlers. A template name could have been dynamically added here and used in generate. TTL and expiry can be automatically handled using the 3rd and 4th parameter of processCache.
generate: gets the cache file ($file) and all arguments ($args) as parameters It generates the HTML just like the view would have. processCache will first call retrieve(), then fall back to generate() if no cache file exists It would have checked for expiry and/or ttl if they had been provided. It will also handle the stalecache aspect, and serve an old cache file while the new one is being generated.