Embedder Session Cache

The embedder session cache stores data and other information that the PopChart Embedder sends over the comm port. By storing this information in the key cache, PopChart Server is able to return a PopChart image to a browser more quickly when it is requested.

The information will remain in the embedder session cache for a certain period of time, known as its session time, after it is stored. The implications of this behavior are: 1) the information will disappear after a certain time even if it is not requested, and 2) if the information is requested multiple times during this period, each request will be sped up by using the embedder session cache. By default the session time is twenty minutes.

PopChart Server sets aside a certain amount of RAM for the embedder session cache. By default, the cache will use ten megabytes of RAM. If the embedder session cache ever grows beyond this size, it will begin using disk space to store the embedder session cache. Older objects will be moved from RAM to disk to make room for newer objects. By default, the embedder session cache is located in the cache_root/keycache directory.

You can change embedder session cache settings in the Administration Console on the Settings > Embedder Session page.

The exact effects of changing the embedder session cache are hard to predict, and will vary greatly depending on server load and system specifications. However, changes generally will not have a significant effect on PopChart Server performance.

Circumventing the Embedder Session Cache

PopChart Server uses an embedder session cache to store information (such as data and appearance files) about each image that the PopChart Embedder embeds into a web page By default, PopChart Embedder only embeds an embedder session ID within the actual web page. When a browser requests an image with this ID, PopChart Server looks up this ID in the embedder session cache and retrieves the appropriate information.

Note: The JavaScript PopChart Embedder does not use the embedder session cache. It will always make a full request.

For example, the code below shows how PopChart Embedder would typically embed a GIF image. @_CPRBB_Phjd_gBSy is the embedder session ID.

<img src="http://popchart.mycompany.com:2001/?@_CPRBB_Phjd_gBSy@_GIF>

Alternatively, PopChart Embedder can embed all of the information about a PopChart within the actual web page. In other words, the web page contains the full request for the PopChart image. In this case, the same embedded image might look something like this:

<img src="http://popchart.mycompany.com:2001/?@_FILEapfiles/bar.pcxml@_PCSCRIPTgraph.setcategories(Red;Yellow;Green)graph.setSeries(Line1;35;65;12)@_GIF">

Note: If you are passing a lot of data in PCScript, this request can grow to be quite large.

The advantages of having PopChart Embedder use the embedder session cache are two-fold: 1) it decreases the size of your web pages; 2) it circumvents issues that certain browsers and image formats have with long URLs (refer to "Overcoming the URL Length Restriction").

However, in some circumstances—for example, when you are using the PopChart Embedder to generate static web pages that will be accessed after the embedder session time has expired—it may be desirable not to use the embedder session cache. If this is the case, you can disable the embedder session cache by setting the PopChart Embedder makeFullRequest attribute to true, as illustrated below:

myPopChart.makeFullRequest = true;

You can also instruct PopChart Embedder to use the embedder session cache only when the full request would be longer than a certain URL length (thus circumventing the URL length restriction). To do this, set makeFullRequest to true and then set the maxRequestLength attribute to the maximum request length. For example, to have PopChart Embedder use the embedder session cache for any images where the full request would be longer than 2000 characters, you would use the following lines of code:

myPopChart.makeFullRequest = true;

myPopChart.maxRequestLen = 2000;