SixSigns Blog

Enrich people’s lives and web experience
Ads

FuseBox and caching

Within our application we make full use of the latest FuseBox release together with ColdFusion 8 and the integrated Ajax functionality.

Lately we have been working on a "bug" where the language (when switched) is stored in a session variable and the pages displayed accordingly to the selected language. Now, what has happened is that the session variable has been set, but the pages did not display in the selected language.

First off, we thought that the session variables have been lost or the cftokens not passed correctly. But then after a while we figured that when one refreshes the cache of the browser the pages show in the correct language.

Thus it all boiled down, that we had to tell the browser not to cache the pages. this we achieved with the <cfheader> tag, like;

<cfheader name="Expires" value="#GetHttpTimeString(Now())#">

<cfheader name="CACHE-CONTROL" value="NO-CACHE, no-store, must-revalidate">
<cfheader name="PRAGMA" value="#GetHttpTimeString(Now())#">

Now, the pages reflect the language change correctly and we are all happy again.

Share and Enjoy:
  • Facebook
  • Digg
  • TwitThis
  • Sphinn
  • del.icio.us
  • Mixx
  • Google
  • MisterWong
  • StumbleUpon

If you enjoyed this post, make sure you subscribe to my RSS feed!

Post Metadata

Date
November 21st, 2007

Author
SixSigns

Category

Tags

Leave a Reply