From: bob on
Hi,

Can someone please suggest a reliable way of forcing refresh of a site that
has been updated? I'm running into problems with java script and some
images (e.g. menu backgrounds, buttons, etc.) which do not always get sent
to clients after being changed.
The only solution seems for clients to click "Refresh" button in their
browser.

Thanks.


From: Binu T on
Hi,

Make the behaviour of update button to submit
<form method="post" action="/Home/UpdatePage.aspx?Action=Update" >
<input type="submit" runat="server" id="btnUpdate" />
</form>

or

<asp:Button ID="btnUpdate" Text="Update" runat="server" UseSubmitBehavior="true" OnClick="btnUpdate_Click" />

write the btnUpdate_Click method body in code behind page
protected void btnUpdate_Click(object sender, EventArgs e)
{
}

Regards,
Binu



bob wrote:

Force client refresh after site update. How to?
01-Jun-10

Hi,

Can someone please suggest a reliable way of forcing refresh of a site that
has been updated? I am running into problems with java script and some
images (e.g. menu backgrounds, buttons, etc.) which do not always get sent
to clients after being changed.
The only solution seems for clients to click "Refresh" button in their
browser.

Thanks.

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Report Engine, Part 4
http://www.eggheadcafe.com/tutorials/aspnet/5ac799db-385f-431a-8a45-8b37cb7f3186/wpf-report-engine-part-4.aspx
From: bob on
Thanks for the reply. Unfortunately I think that you misunderstood my
original post (it could be that I wasn't very clear).

Anyway, what I'm trying to do is to make sure that if I make any changes to
javascripts in my app on the server those changes will be guaranteed to be
'seen' by all clients that connect to the site afterwards. This generally
happens with aspx pages and most of the images. Unfortunately javascript
resources are not always downloaded to clients after being changed.

For example, one of my clients had been using the app for months with no
problems. A week ago I made some changes to some of java scripts and
updated the site. The first time the client connected to the site after the
update the app was really messed up in his browser. He had to click
"Refresh" button in his browser in order to get the app working properly.

I'm wondering if there is something I could do on the server side to force
client browser to re-load updated java scripts without clients manually
refreshing the associated pages.

Any thoughts?
thanks.


<Binu T V> wrote in message news:20106211820binubee(a)gmail.com...
> Hi,
>
> Make the behaviour of update button to submit
> <form method="post" action="/Home/UpdatePage.aspx?Action=Update" >
> <input type="submit" runat="server" id="btnUpdate" />
> </form>
>
> or
>
> <asp:Button ID="btnUpdate" Text="Update" runat="server"
> UseSubmitBehavior="true" OnClick="btnUpdate_Click" />
>
> write the btnUpdate_Click method body in code behind page
> protected void btnUpdate_Click(object sender, EventArgs e)
> {
> }
>
> Regards,
> Binu
>
>
>
> bob wrote:
>
> Force client refresh after site update. How to?
> 01-Jun-10
>
> Hi,
>
> Can someone please suggest a reliable way of forcing refresh of a site
> that
> has been updated? I am running into problems with java script and some
> images (e.g. menu backgrounds, buttons, etc.) which do not always get sent
> to clients after being changed.
> The only solution seems for clients to click "Refresh" button in their
> browser.
>
> Thanks.
>
> Previous Posts In This Thread:
>
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> WPF Report Engine, Part 4
> http://www.eggheadcafe.com/tutorials/aspnet/5ac799db-385f-431a-8a45-8b37cb7f3186/wpf-report-engine-part-4.aspx


From: Jason Keats on
bob wrote:
>
> I'm wondering if there is something I could do on the server side to force
> client browser to re-load updated java scripts without clients manually
> refreshing the associated pages.
>
> Any thoughts?

http://technet.microsoft.com/en-us/library/cc757114(WS.10).aspx
http://support.microsoft.com/kb/323290
http://dotnetperls.com/expiration-caching
http://dotnetperls.com/cache-examples-aspnet
http://msdn.microsoft.com/en-us/library/aa478965.aspx

From: 3P on
Dnia 02-06-2010 o 04:21:23 bob <robert(a)robert.org> napisa�(a):

> Hi,
>
> Can someone please suggest a reliable way of forcing refresh of a site
> that
> has been updated? I'm running into problems with java script and some
> images (e.g. menu backgrounds, buttons, etc.) which do not always get
> sent
> to clients after being changed.
> The only solution seems for clients to click "Refresh" button in their
> browser.
>
> Thanks.
>

First. For performance reasons static files (js, css, image files) should
have age expires
set to far future (one year is standard). ETag header is unnecessary then
and can/should be removed.

Then when You change these files You rename them for example from
myscripts.js
to
myscripts_v2.js

Or You add query parameters on pages where those files are used.
So instead of <img href="picture.gif">
You do <img href="picture.gig?v=2">

You can try to make it full auto and add for example assembly version to
all the references to those files.