logo

Flex With Domino - Solving Caching Issues

A couple of people have asked me about caching and Flex. Once or twice about the datagrid and a couple of times about the session object not accepting that the user was logged-in in the simple demo.

To get round this you can add an extra parameter to the HTTPService to add anti-caching to it, like so:

ScreenShot001

Each time the service requests the session.object form it adds a different ending to the URL, such as:

/apps/flex.nsf/flex/session.object?ReadForm&nocache=1234476539548

Problem solved.

Note also that you can pass the parameters to the HTTPService via (Action)Script rather than by nesting them in an <mx:request> object, with a function like this:

private function requestSessionData():void{
        var params:Object = new Object();
        params.nocache = new Date().getTime();
        httpSession.send(params);
}

Which you use is down to both personal preference and, to a degree, circumstance. With the latter method you get the choice of which parameters you do or don't want to send. Not so with the request object.

Comments

  1. The link to "simple demo" is broken. Should probably be apps, rather than aaps.

    Cheers!

  2. Deciding which approach brings components to mind. Since you can have a component completely made up of MXML -or- ActionScript, it's good to have two ways to tackle this.

    • avatar
    • David McGaughy
    • Mon 16 Feb 2009 07:41 PM

    Thx Jake, this helps me greatly.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Fri 13 Feb 2009

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content