Cache Directory

Last Updated: 5/6/2009



Sections above here:
Home  »  Development  »  Caching

Sections below here:

    Topics in this section:
    Cache Directory

    Search Documentation:

    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.

    Important Notes

    • Exclusive Use - Files and subdirectories older than the value (in minutes) in ServerController.CacheExpiry are deleted.  Do not set the CacheDir property to a directory that has files you do not want deleted.
    • Full Permissions - when deploying an IntraWeb application, always make sure that it has full access (read, write, modify etc) to the Cache directory, otherwise the application will run with unpredictable results (access violations, internal errors etc). 

    Global Cache Directory

    The global cache directory is accessible for all 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;
    ...
     LFilePathName := GServerController.NewCacheFile('XYZ');

    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 Directory

    The User Cache Directory is private per user session. It is protected by a non decomposable session id.

    To find the URL to a file in the User Cache Directory, use this approach:

    uses IWGlobal;
    ...
     LFileURL := GServerController.UserCacheURL + 'mytempfile.tmp

    The physical location can be determined this way:

    LFileURL := GServerController.UserCacheDir + 'mytempfile.tmp'

    A new cache file can be created using this syntax:

    xFilePathName := GServerController.NewCacheFile('XYZ', true);

    Additional Info



    (C) 2002-2009 - Atozed Software Ltd.