Fork me on GitHub

cache 1.0.131

node:

Text

THE
html(Text %enc)
FUNCTION
mixer
cache 1.0.131
category
Cache
{
Overview

An overload of the html function that does the cache stuff as well.

This html function sets up the page so that content you label dynamic is fetched as needed, but still allows the static section of the page to be cached. The following example will open an html scope and set up the page so that all divs with the "dynamic" attribute are stripped out and will be loaded later.

*
Argument
Type
Name
Text %enc
Example
cache.html("utf-8") {
  $("//div[@dynamic]") {
    cache.dynamic_section()
  }
}
»
View Source
node:

Text

THE
dynamic_section()
FUNCTION
mixer
cache 1.0.131
category
Cache
{
Overview

This function goes hand-in-hand with the cache.html function to allow dynamic sections to be flagged and loaded later.

Use this function to specify dynamic content that should not be cached. The following example will open an html scope and set up the page so that all divs with the "dynamic" attribute are stripped out and will be loaded later.

*
This function has no arguments
Example
cache.html("utf-8") {
  $("//div[@dynamic]") {
    cache.dynamic_section()
  }
}
»
View Source
node:

Base

mixer
cache 1.0.131
category
Cache
{
Overview

Enables caching of things for a specified period of time.

This function will set the necessary headers to tell Moovweb to cache the current response. The parameter is the number of seconds to cache things for. The following example will cache the stuff on the page for 1 minute.

*
Argument
Type
Name
Text %seconds
Example
cache.enable_for("60") # set the cache headers for 60 seconds
»
View Source
node:

Base

mixer
cache 1.0.131
category
Cache
{
Overview

Forces caching of things for a specified period of time in Moovweb's cache only.

This function will set the necessary headers to tell Moovweb to cache the current response and strip other caching headers out. The parameter is the number of seconds to cache things for. The following example will cache the stuff on the page for 1 minute.

*
Argument
Type
Name
Text %seconds
Example
cache.force_for("60") # remove other cache headers and set ours for 60 seconds
»
View Source