views:

53

answers:

0

I have a web service application which uses the Context.Cache to store some information. This information is read from a file so I have added the item to the cache and used a CacheDependency with the file path as the arg hoping that when the file time stamp changes, the cache would be invalidated.

The file in question is replicated to 2 locations (due to project needs) and they are in different time zones (USA and India). USA hosts the file and India site gets a replicated copy of the file every 10 mins or so. The web service in question is also hosted at these two sites accordingly. The web service in India site points to the local file (the one that will be replicated from USA). The file is on a UNC share in US and India location.

What we observe is that the web service detects changes in the file at the US location without any problems. The file, when changed at US location also gets copied to the India location without any problem. However, the web service at India location is not able to detect the change in the file's time stamp and refresh its cache.

In this whole scenario, India time is ahead of US time by 30 mins right now. So, Initially we thought it is because of the time stamp changes but then when the replication of the file occurs, the file at India does receive a time stamp which is newer w.r.t local time.

I might have to write a new custom cache class but before that I wanted to know if anybody has seen this before and if so, any help appreciated.

Also, does anybody know how the FileDependency class internally determines the change in file? is it time stamp based or content size based or a combination of both?

thank you

sb