Partager via


Automatic refresh in SharePoint Document Libraries

It was very interesting to find out that the list of documents refreshes only once automaticaly in the browser window. The issue is if you open for editing an Office document it should appear as checked out for editing. Now if you edit the document and durring this time you will change the focus on the browser window where you have the list of files, then at the momet you save the file and check it in from Office application, if you will look in the browser you will see that the file is still checked out. If you will do a refresh the file will be diplayed correctly.

This is the way I tried to explain this behavivor:

The data from any server (and a SharePoint server too) is sent to the client only when the client is asking for it and only then. In our case the clients would be the browser (Internet Explorer) and the Office application (let's say Microsoft Office Word).

If the client is not asking to refresh the page the question would be then – and why sometimes it happens to the page to be refreshed? It is because the SharePoint page contains a javascript code that perform a request to the server, and now we should see when this request is made and what do we do to start it.

The request to refresh the page is made first time we are focusing on the browser window again after opening a document in Office.

To test it you can follow the following steps:

1. Open a SharePoint document library in the browser

2. Open an Office file by just clicking on it

3. Switch back the focus to the browser and you will see that the page is refreshing

So if a user want to be sure that he will be able to see the document status correct without pressing F5 (refresh) he should consider the following – don't switch the focus to the browser window until the moment you made the modification you want to see it on the page.

Now we know that the server cannot force the client (browser) to refresh the page even if he received from another client application (Word) the confirmation that the file status was modified. And the "automatic refresh" of the page is actually not made by the server, it is made by a javascript code running on the client side.

We could say that that javascript which makes the first request for refresh can do it:

- On every focus on the browser window

- Every 1 minute (or another amount of time)

These ideas are not acceptable because they will generate an extra loading of the network bandwidth.

For the first idea let's imagine that we have a user that switches the window with Alt+Tab and he gets all the time on our browser window, or you can imagine other situations where a lot of users are just getting back to the page and the server receives requests over and over to respond with the a fresh rendered page.

For the second idea we have the same considerations – one hundred users just keeping the page open will generate one hundred requests every minute (or period of time that could be established).

The only possibility to change this behavior would be to change the javascript code used by the page, however this approach will make the product not supported.

Comments

  • Anonymous
    August 06, 2009
    Is it possible to disable this behavior? If the answer is YES? How can i do this? I dont want the page to be refreshed each time i switch the focus to the browser window. Thanks!

  • Anonymous
    August 06, 2009
    The comment has been removed

  • Anonymous
    August 06, 2009
    Thank you for the very quick answer!

  • Anonymous
    August 16, 2010
    My company's Sharepoint site is set up to refresh the page each and every time I open a Word doc, whether I edit the doc or not and I hate it!  It brings me back to the top of the page, and I have to keep scrolling down to find the next document in the list.  I would like to turn OFF this automatic refresh if possible. p.s. Great help here. If you don't mind a tip for English usage, we do not use "an" before "user" because user is pronounced as if there is a Y in front of the word. So no N is required.  Example "an umbrella" because U is pronounced like uuuhhh  but "a user" because it's pronounced like you-zer.

  • Anonymous
    August 17, 2010
    As mentioned before, to disable this behavior, the best way is to create a custom master page for you site. This is the best approach, because the updates will not touch the custom files. (Check this article msdn.microsoft.com/.../bb727372(office.12).aspx). From your point of view (not a SharePoint administrator), you can think of a workaround like:

  • creating personal views with fewer documents (in order to avoid the scroll for the next document)
  • use a JavaScript function blocking add-in (I think you might need to develop one, and it might take a little time) p.s. Thanks for the tip with the indefinite article.
  • Anonymous
    September 08, 2011
    hello, is there the same problem on MOSS 2010? or it was fixed Best regards

  • Anonymous
    September 09, 2011
    Is there the same issue on MS-SharePoint 2010?

  • Anonymous
    September 14, 2011
    Hi, If my document library containing mht files, every time I required to F5 refresh to make the item updated. any workaround you can suggest?

  • Anonymous
    September 15, 2011
    @joapen:

  1. It is not a problem. It a behavior that should help the end users. (the fact that it will not help in every situation, does not make it a problem)
  2. In the 2010 version the behavior was preserved, with a big difference - now, when you click on the file it should open it using Office Web Apps - the file will not be open in the Office application on your desktop, but the one on the server @sams: I am not sure if I understood exactly what are you looking for. You are opening the .mht file to edit in MS Office Word? What exactly is not updated (the modify date, last modified by)?
  • Anonymous
    January 29, 2012
    The comment has been removed
  • Anonymous
    November 24, 2015
    Why not to trigger the webart "ManualRefresh" button. you can add him with the ajax options to the library webart and to change the time to 15 seconds of automatic refresh or to add a jquery code on the master page to trigger the button to with the ID="ManualRefresh" to 1 or 2 seconds - works charm to me