Offline file caching in Longhorn Server

by [Published on 26 Oct. 2006 / Last Updated on 26 Oct. 2006]

This article takes a look at some of the ways that Longhorn Server facilitates offline file caching.

Previously I wrote an article on Windows Vista’s Sync Center and how it facilitates the synchronization of offline files from various sources. In this article, I want to take a look at some of the ways that Longhorn Server facilitates offline file caching.

Longhorn Server’s file caching feature has been greatly improved over the previous version. In case you are not familiar with offline file caching, the basic idea behind it is that when a client accesses a share on the server, that share’s contents are automatically cached. If the user attempts to access the share at a later time when no connectivity to the server exists, then the user’s workstation will transparently use the cached copy. Any changes that the user makes to cached files will be automatically synchronized with the server the next time that the user establishes a connection to the share.

File caching existed in Windows Server 2003 and in Windows XP, but has been improved in Longhorn Server and in Windows Vista. I’m really getting ahead of myself though. Before I talk about the ways that the file caching feature has been improved, I want to take a moment and show you how to configure file caching.

The steps for configuring offline file caching in Longhorn are very similar to the steps used in Windows Server 2003. You must begin the process by creating a share on your server. Even though the process of sharing a folder is pretty simple, I want to walk you through file sharing in Longhorn because it has changed a little bit from what you are probably used to.

To share a folder, right click on the folder and select the Properties command from the resulting shortcut menu. When you do, you will see the folder’s properties sheet. Select the properties sheet’s Sharing tab and click the Share button. If you look at Figure A, you will notice that the Sharing tab contains both a Share button and an Advanced Sharing button.

Figure A: The Sharing tab contains both a Share button and an Advanced Sharing button

Since the primary focus of this article is on caching, not sharing, we will do things the easy way and click the Share button. When you do, you will see a screen asking you who you want to share the folder with, as shown in Figure B.

Figure B: The mail File Sharing screen asks who you want to share the folder with

Make your selection and click the Share button. The folder is technically shared at this point, but Windows will stop and display the screen shown in Figure C. This screen is a nice touch, because it gives you a chance to e-mail the path to the share to the people who have access to the share.

Figure C: You can e-mail the share path to those who have access to the share

Now that we have created a share, we need to enable caching. To do so, go back to the folder’s properties sheet’s Sharing tab and click the Advanced Sharing button. When you do, you will see the Sharing dialog box, shown in Figure D.

Figure D: The Sharing dialog box contains a caching button

As you can see in the figure, this dialog box contains a caching button. Before I move on, I want to quickly point out a couple of other new features. If you look at the figure, you will see that you can now limit the number of connections to the share and you can also now place deleted items in the recycle bin! This is a biggie because previously if you deleted an item from a network share, it was just gone. There was no option to put it into a recycle bin.

When you click the caching button, you will see that there are a couple of different options available to you, as shown in Figure E. You can elect to cache only the files specified by the user, or you can cache everything. In most cases you will probably only want to cache files specified by the user, although caching everything is an option if you have the resources.

Figure E: You can cache either files requested by the user, or everything

Click OK a few times to close any open dialog boxes and you are all done on the server end. Now it’s time to configure the client. To do so, open the file share, and right click within an empty area of the window that displays the files within the share. Select the Properties command from the resulting shortcut menu, and after a brief delay you will see the share’s properties sheet (this is different from the properties sheet that you saw on the server). Now, simply select the properties sheet’s Offline tab, shown in Figure F, and then select the Always Available Offline check box. Click OK to continue.

Figure F: Select the Always Available Offline check box

That pretty much does it for the setup and configuration, but I promised you that I would spend some time at the end of this article and talk about some of the new features.  In my opinion, the best new feature is the way that Longhorn handles open files. In order to appreciate this, you have to look at what happened in Windows Server 2003 / Windows XP. Suppose that you had a Microsoft Word document open and you lost network connectivity for some reason. You could continue working, but when the server came back online, you would have to synchronize. The problem is that Windows was unable to synchronize open files. You would get the error message shown in Figure G, telling you to close your document and try again.

Figure G: Windows XP / 2003 would produce this error message if you attempted to synchronize while a file was open

On the other hand, Longhorn converts open file handles to file handles on the server. What this means is that you can synchronize without having to close your documents.

Another difference is that in Windows XP, if even one file cannot be synchronized, then the entire server is considered to be unavailable and no shares can be accessed. This problem was especially bad for organizations using distributed DFS namespaces because a single share could span multiple servers. Therefore if one server went down, the entire DFS namespace could potentially be considered to be unavailable. In Longhorn / Vista, availability is determined at the file level, not at the share level.

One last change that I want to talk about is that you no longer have to wait for synchronizations to complete before you can get on with your life. For example, suppose that you had a laptop computer running Windows XP that was configured to cache lots of files. Now suppose that you had been working offline, but now you are connected to the network again and you transition your status to online. You would now have to stop and wait for all of your cached files to synchronize before Windows would truly treat the session as being online. In Longhorn and Vista, you can begin working online while your cached files synchronize in the background.


In this article I have explained that in Longhorn Server and in Windows Vista, there have been some significant changes to the way that offline caching of files works. I then went on to discuss some of these changes and walked you through configuring file caching.

See Also

The Author — Brien M. Posey

Brien M. Posey avatar

Brien Posey is an MCSE and has won the Microsoft MVP award for the last few years. Brien has written well over 4,000 technical articles and written or contributed material to 27 books.


Featured Links