Thursday, March 15, 2007

Too enthousiastic Flex caching

I've been trying to call a dynamic ASP.NET webpage multiple times (each time the page returns different information).

It seems that Flex is, by default, caching the response. The 'ugly' way is to append some unique id at the end of the url to force a new request (http://somewebsite/stockquotes.aspx?ID=1, http://somewebsite/stockquotes.aspx?ID=2, ...).

There is however also a 'nice' way to solve the problem (at least if you have access to the ASP.NET source code). Just add the following code to your ASP.NET page (for example in the Page_Load method): Response.Cache.SetCacheability(HttpCacheability.NoCache);

No comments: