Scenario: Suppose there is a windows application called ‘WinApp’. It has import module to import some excel data to some database. This module has a browse button to browse the file from user’s local drive. This application has been published in XenApp environment for the users to access it from ICA Web interface.
Problem: When users are accessing this application from ICA web interface and when they are browsing their local excel file to import its data into the database for the first time, it will be loaded into the database successfully but after successful import if user has changed the import excel file within 60 seconds then following two conditions could happen:
- Database not updated within 60 seconds: If there is a grid on the import screen to display the data that has been uploaded and currently displaying the data of the first successful import, the grid will not get refreshed with the actual data for 60 seconds as data has not been inserted/updated into the database. As soon as 60 seconds are over, data will be written to the database and will be displayed on the grid.
- Original excel [import file] at the User’s local machine could be overwritten with the previous data: Suppose the excel has one column and one row with data as “test”. If will be imported successfully for the first time. As soon as it is imported if user changed it to say “test1” and import it within 60 seconds, the excel will be over-written with the previous data “test” and nothing will be imported.
Reason of the above two issues, is the caching mechanism of the XenApp Server and the value is by default set to 60 Seconds. This means that XenApp maintains cache for 60 sec and after that amount of time XenApp flushes out the cache data and reloads it with the fresh data.
Solution: We could resolve the above issues by reducing the cache timeout value to some lower value [say 10 sec] or to Zero [0 Sec] by modifying CacheTimeout and DirCacheTimeout keys in registry.
Details of these keys:
File caching time out value (default: 60sec)
Directory caching time out value (default: 30sec)
Note: Registry editing should be done with extreme care as it could corrupt the operating system. Recommended way is to take the backup of registry before doing any changes.