A very nice technique that works on all browsers (but only for
resources from the same domain) is to do a PUT XMLHttpRequet:
new (XMLHttpRequest).open('PUT','path/to/resource',true).send();
not sure chaining works but this is sure to clear the resource from cache
On 7/14/11, Thierry bela nanga <[email protected]> wrote:
> you can use window.location.reload(true) to reload the page from the server,
>
> https://developer.mozilla.org/en/window.location
>
>
> On Thu, Jul 14, 2011 at 2:37 PM, Eric Patrick <[email protected]> wrote:
>
>> That technique is workable, but a bit cumbersome in my use case. When
>> a user first navigates to a Dashboard page, the URI pulled would not
>> include the nonce parameter. Easy enough to have the 'refresh now'
>> command add the nonce.
>>
>> However, the user will typically drill down to another page, leaving
>> the Dashboard page, only to return to the Dashboard page shortly
>> thereafter. At this point, the Dashboard page will load the 'default'
>> URI (without the nonce parameter).
>>
>> So, I'd need to modify the control to track the 'nonce' URI across
>> page views (e.g. put it in a cookie; if the cookie exists, use it,
>> else use the 'default' URI). Certainly doable.
>>
>> However, I was hoping for a slick version along the lines of new
>> Location(default URI).reload().
>>
>> Thanks for the feedback!
>>
>> Eric
>>
>> On Jul 14, 3:04 am, Sean McArthur <[email protected]> wrote:
>> > Whenever I wish to break cache, I include a nonce GET parameter.
>> >
>> > '&nonce=' + (new Date()).getTime()
>> > On Jul 13, 2011 5:44 PM, "Eric Patrick" <[email protected]> wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > I have a "dashboarding" control that fetches a JSON representation of
>> > > a SQL cube via Request.JSON. For large cubes, my control has
>> > > options.cache which is passed to the server, and the server will
>> > > respond with a cache expiration header. This has worked out quite
>> > > well, as it elegantly leverages the browser's native caching
>> > > capability. The URI being cached is something like:
>> >
>> > > /DashboardService.asmx/JSON?procedure=MyDashboardProcedure&cache=600
>> >
>> > > I'd like to introduce the ability for a user to "force" a clearing of
>> > > this cached resource.
>> >
>> > > Training users to use Ctrl-F5 is both inelegant and inefficient, as it
>> > > would force an unnecessary reload of other cached items.
>> >
>> > > I could simply change the URI that I am calling, but the typical use
>> > > case is that a user want to get the 'refreshed' cube, and then keep
>> > > that current cube in cache for the default cache duration (600 seconds
>> > > in this example).
>> >
>> > > Any suggestions?
>> >
>> > > Thanks in advance,
>> >
>> > > Eric
>>
>
>
>
> --
> http://tbela99.blogspot.com/
>
> fax : (+33) 08 26 51 94 51
>
--
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il