Opening Excel Documents from the WCI Knowledge Directory

I had a client report this strange issue with Excel file handling in IE7 and IE8 (and Office 2007).  Basically, every time someone would open a document, it would get cached by IE.  But the next time the person would try to open the same document, they’d get a “file is locked by user” message.  It seemed IE was caching the file in the Temporary Files folder, then when the user would click the link a second time there was a conflict between the existing file in that folder and the new one IE was trying to bring in.  I found some articles and discussions on the topic, but most came back to making changes on the client-side, which is never easy to do in an enterprise.  Even if it’s a little trickier to execute, you should always try to make changes on the WebCenter Portal side.

In this case, after downloading the Excel file the first time, I confirmed it was in my Temporary Internet Files folder:

 Temp Files

I was also able to verify that the portal was returning a “Not-Modified” header when the user tried to open this Excel document again:


The fix I applied here?  Another BigIP iRule that turns off caching of Excel files – after the jump.

The BigIP iRule is:

if { [HTTP::header Content-Type] contains "ms-excel"} {
    HTTP::header replace "Expires" "-1"
    HTTP::header remove "ETag"

… and as you can see, the HTTP headers now make sure the content isn’t cached, which prevents Excel from failing when opening cached documents:

No Cache

This fix doesn’t feel like the best approach, but it has worked for me.  Have you had this problem yourself?  Got a better resolution/workaround?  Let us know in the comments!

Tags: , ,

Leave a Reply