CSP Gateway Configuration Guide - InterSystems Documentation
CSP Gateway Configuration Guide - InterSystems Documentation
CSP Gateway Configuration Guide - InterSystems Documentation
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>CSP</strong> <strong>Gateway</strong> Operation and <strong>Configuration</strong><br />
This would result in every single page, for each state, being cached independently of one another for two hours:<br />
Weather.csp<br />
Weather.cspState=WA<br />
Weather.cspState=TX<br />
...etc.<br />
Now suppose that we add further functionality to show the weather for a specific city. In order to cache pages based on the<br />
state and city parameter, we would change the cache directives to:<br />
%response.Expires=[2 hours time]<br />
%response.VaryByParam="State;City"<br />
The ASP.NET equivalent would be:<br />
<br />
The VaryByParam property allows us to cache multiple versions of the same page based on parameters sent through HTTP<br />
GET/POST. Be extremely careful when using *, as this can potentially fill the output cache with pages that are not frequently<br />
accessed. Remember, the more specific we make the VaryByParam property, the more frequently the <strong>Gateway</strong> can serve<br />
pages from the cache. For example, when only specifying a state, we have 51 versions of the page in the cache (50 states<br />
+ the version with no parameters). When the city parameter is added, and assuming that we have an average of 15 cities<br />
per-state, we suddenly increase the number of potentially cached pages to 751.<br />
The <strong>Gateway</strong> automatically evicts pages from the cache if it becomes constrained by memory as a result of the total volume<br />
of the cache becoming too large.<br />
2.7.3 Preserving the User’s Session ID for Cached Pages<br />
The requesting user’s session ID must be preserved within pages retrieved from the cache, regardless of whether the session<br />
is being maintained via a Cookie (<strong>CSP</strong>SESSIONID) or via the token (Form/URL variable: <strong>CSP</strong>CHD).<br />
When a page is cached it is cached against the identity of the user that actually retrieved the page from Caché. This page<br />
contains the session ID as either the <strong>CSP</strong>SESSIONID cookie or as the <strong>CSP</strong>CHD token. Before serving a cached page to the<br />
user, the <strong>Gateway</strong> replaces all occurrences of both variables with the requesting user’s session token. In fact, the session<br />
cookie is actually removed from the cache, which achieves the same thing because the Cookie is preserved on the requesting<br />
user’s browser.<br />
For example, let’s suppose that a page is cached by user xxxxxxx. The page is cached with the following identity:<br />
Set-Cookie: <strong>CSP</strong>SESSIONID=xxxxxxx;<br />
Now, when another user aaaaaaa subsequently retrieves this page from the cache, the cookie is, theoretically, changed<br />
to:<br />
Set-Cookie: <strong>CSP</strong>SESSIONID=aaaaaaa;<br />
In fact, as mentioned previously, the cookie is simply left alone on the requesting user’s browser.<br />
The <strong>Gateway</strong> must, however, take action for pages that maintain the user’s session through the session token, <strong>CSP</strong>CHD. In<br />
this case, the initial cached page contains references to the original user as shown below:<br />
<br />
<br />
The <strong>Gateway</strong> automatically changes the value of the session token to reflect the identity of the requesting user. For example,<br />
when user aaaaaaa subsequently requests this page from the cache, the <strong>Gateway</strong> modifies these lines as follows:<br />
<br />
<br />
46 <strong>CSP</strong> <strong>Gateway</strong> <strong>Configuration</strong> <strong>Guide</strong>