ajile: Learn: FAQ: Browser Caching



Back to Documentation


Q: Can Ajile manage the browser's caching of loaded scripts and imported modules?

A-General:

Yes. Ajile 0.7+ provides Ajile.EnableRefresh() and the refresh load-time option to support forcing the browser to generate fresh requests for loaded scripts and imported modules. Ajile 0.6.5 and earlier versions don't explicitly manage the browsers caching of loaded or imported scripts.

A-Detail: Caching and the Load and Import processes:

The following describes the behavior of Ajile's Load and Import directives as they relate to browser caching:

1. Load instructs the browser to load the specified script file from the specified location.

2. Import uses Load to load the corresponding script file for the specified module or namespace.

3. Import only uses Load if the specified module or namespace isn't already in memory. For example, the

Import("com.iskitz.ajile.examples.ImportExample");
statement will only instruct the browser to load the script file if the ImportExample object or property is undefined or equal to null.

When Ajile.EnableRefresh() or the refresh load-time option are used, the browser will be forced to load the specified script from its source location. When they are not used, the browser will use it's own cache settings to determine whether to load a script from its source location. If the script resides on a web server, the web server may set headers that instruct your browser to serve the script from its cache rather than reloading it from the web server.


Back to Documentation