[HOME] jsMath (Authors) [Prev][Up][Skip][Next]

The noCache plugin

As of version 3.3, jsMath uses an equation cache to help speed up processing of repeated mathematical expressions. Under rare circumstances, this might cause jsMath to display an equation incorrectly. (For example, if an expression uses a macro and the definition of that macro changed between the first and second occurrance of that expression.)

You can disable the cache for an individual expression by starting its TeX code with \nocache, or by setting the class of its SPAN or DIV to "math nocache" rather than just "math". In either of these cases, the HTML will not be taken from the cache, and the resulting HTML will not be stored in the cache (that is, the cache is bypassed entirely).

It is also possible to force jsMath to clear the cache by calling jsMath.Global.ClearCache() (this is true whether the cache is being stored globally or not). This is more drastic than not using the cache for an individual expression. Note that if the user has requested the global equation cache, this will clear all the cached data, so use it with care.

Finally, if you do not want to use the equation cache at all for your page, you can include the line

    <SCRIPT> jsMath.Setup.Script("plugins/noCache.js") </SCRIPT>
just after the command that loads jsMath.js itself, or if you are using easy/load.js, then add "plugins/noCache.js" to the loadFiles array, as in:
    loadFiles: ["plugins/noCache.js"],
This will prevent jsMath from using any form of caching, regardless of whether the user has initiated Global Mode or not. This will avoid any chance of displaying the wrong mathematics, at the expense of possibly taking longer to render the page. The effect of this is essentially to put jsMath back to its pre-3.3 state, at least as far as caching is concerned.

Get jsMath at SourceForge.net. Fast, secure and Free Open Source software downloads [HOME] jsMath web pages
Created: 02 May 2006
Last modified: 12 May 2007 06:31:46
Comments to: dpvc@union.edu
[Next] The CHMmode plugin
[Skip] Browser Support for jsMath
[Up] Information for jsMath Authors
[Prev] The global plugin