ApplicationDefinition.xml and the browser cache

View: New views
4 Messages — Rating Filter:   Alert me  

ApplicationDefinition.xml and the browser cache

by gingerbbm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Any tips on definitively emptying the browser cache between edits of ApplicationDefinition.xml? Both Firefox and IE resiliently hold on to old versions and it's very irritating. Does anyone have a solution?

I tried the following change in fusion.js but although initially the results were promising it appears to breaking something else (which I've not yet had time to investigate):

this.applicationDefinitionURL = 'ApplicationDefinition.xml?rand=' + parseInt(Math.random()*99999999);

Thanks
Stuart

Re: ApplicationDefinition.xml and the browser cache

by pagameba :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stuart,

I think some browsers or web servers complain if you add query string  
parameters to a GET request for static content.

There is supposed to be a way to modify the request headers on the  
client side to avoid caching, I'm pretty sure that hasn't been done in  
the fusion code yet.

Obviously for production use, you want caching enabled so typically  
for development/debugging we use the web development extension for  
FireFox which provides an option to disable the cache and a shortcut  
to clear the cache.  For IE, there is a similar developer toolbar  
which allows you to clear the cache quickly, and another thing called  
IE Tester which allows you to run different versions of IE in tabs  
that has a Refresh Complete (no cache) option.

Cheers

Paul

On 19-Aug-08, at 4:27 AM, gingerbbm wrote:

>
> Any tips on definitively emptying the browser cache between edits of
> ApplicationDefinition.xml? Both Firefox and IE resiliently hold on  
> to old
> versions and it's very irritating. Does anyone have a solution?
>
> I tried the following change in fusion.js but although initially the  
> results
> were promising it appears to breaking something else (which I've not  
> yet had
> time to investigate):
>
> this.applicationDefinitionURL = 'ApplicationDefinition.xml?rand=' +
> parseInt(Math.random()*99999999);
>
> Thanks
> Stuart
> --
> View this message in context: http://www.nabble.com/ApplicationDefinition.xml-and-the-browser-cache-tp19046219p19046219.html
> Sent from the Fusion Users mailing list archive at Nabble.com.
>
> _______________________________________________
> fusion-users mailing list
> fusion-users@...
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/

_______________________________________________
fusion-users mailing list
fusion-users@...
http://lists.osgeo.org/mailman/listinfo/fusion-users

Re: ApplicationDefinition.xml and the browser cache

by Paul Deschamps :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Essentially what we need to do is modify the headers like so
before we get the applicationDef. :

request.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');

A workaround for now can be done easily in your applications
javascript, before you call Fusion.initialize

    var options = {};
    options.applicationDefinitionURL =
szApplicationRoot+'/ApplicationDefinition.xml?rand='+randomNumberHere;

    Fusion.initialize(options);
    Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, onInitialize);

This method can also be used if you have some php file that generates
your applicationDefinition.

 options.applicationDefinitionURL =
szApplicationRoot+'/ApplicationDefinition.php'

Cheers

Paul D.


On Tue, Aug 19, 2008 at 8:45 AM, Paul Spencer <pspencer@...> wrote:

> Stuart,
>
> I think some browsers or web servers complain if you add query string
> parameters to a GET request for static content.
>
> There is supposed to be a way to modify the request headers on the client
> side to avoid caching, I'm pretty sure that hasn't been done in the fusion
> code yet.
>
> Obviously for production use, you want caching enabled so typically for
> development/debugging we use the web development extension for FireFox which
> provides an option to disable the cache and a shortcut to clear the cache.
>  For IE, there is a similar developer toolbar which allows you to clear the
> cache quickly, and another thing called IE Tester which allows you to run
> different versions of IE in tabs that has a Refresh Complete (no cache)
> option.
>
> Cheers
>
> Paul
>
> On 19-Aug-08, at 4:27 AM, gingerbbm wrote:
>
>>
>> Any tips on definitively emptying the browser cache between edits of
>> ApplicationDefinition.xml? Both Firefox and IE resiliently hold on to old
>> versions and it's very irritating. Does anyone have a solution?
>>
>> I tried the following change in fusion.js but although initially the
>> results
>> were promising it appears to breaking something else (which I've not yet
>> had
>> time to investigate):
>>
>> this.applicationDefinitionURL = 'ApplicationDefinition.xml?rand=' +
>> parseInt(Math.random()*99999999);
>>
>> Thanks
>> Stuart
>> --
>> View this message in context:
>> http://www.nabble.com/ApplicationDefinition.xml-and-the-browser-cache-tp19046219p19046219.html
>> Sent from the Fusion Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> fusion-users mailing list
>> fusion-users@...
>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>
> __________________________________________
>
>   Paul Spencer
>   Chief Technology Officer
>   DM Solutions Group Inc
>   http://www.dmsolutions.ca/
>
> _______________________________________________
> fusion-users mailing list
> fusion-users@...
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
_______________________________________________
fusion-users mailing list
fusion-users@...
http://lists.osgeo.org/mailman/listinfo/fusion-users

Re: ApplicationDefinition.xml and the browser cache

by gingerbbm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What made matters worse for me was that I was connecting via a proxy server which was doing its own caching. I realised this when I experienced both IE and Firefox using the same outdated file versions. In this case clearing the browsers' caches was having no impact.

Thanks for the tips. I like the idea of switching off caching completely during development. I'll check out the FF add-on.

Cheers
Stuart
LightInTheBox - Buy quality products at wholesale price!