In order to improve performance, IntraWeb keeps files that can be cached (files from the Files directory etc) in a directory named Cache. By default this directory is created the first time the application saves a cached file in the system temp folder. You can change the default name and location of the cache directory via ServerController.CacheDir. There are several rules that apply to the Cache directory:
Global Cache DirectoryThe global cache directory is accessible for all users/sessions. Files in that directory can be reached from the Web browser like this:http://127.0.0.1:8080/cache/XYZ1234.tmp - where XYZ1234.tmp is a cache file Empty files can be created as follows:uses IWGlobal; That will create a file named XYZ1234.tmp - XYZ is the given prefix, 1234 is a random number, and .tmp cannot be influenced. NewCacheFile()returns the full physical path to the newly created file. User/Session Cache Directorythe User Cache Directory is private per user/session. It is protected by the non-guessable session id. To find the URL to a file in the User Cache Directory, use this approach:uses IWGlobal; The physical location can be determined this way:LFileURL := GServerController.UserCacheDir + 'mytempfile.tmp A new file in the User Cache is created by:LFilePathName := GServerController.NewCacheFile('XYZ', true); |
