Location: PHPKode > projects > 4images > 4images/docs/Cache.english.txt
  ==========================================================
                         Cache
  ==========================================================

  Since version 1.7.1, 4images contains an internal caching
  system. The caching system saves results generated by the
  script as static html files to the disk.
  The next time a visitor requests a page, the result can be
  fetched from the cache and must not be generated again.

  This also has some "disadvantages": Dynamic data such as
  hits, ratings, random images and the "who's online" list
  will also be cached. This dynamic data never changes
  until a cache file is invalidated and generated again.

  If you set $cache_lifetime (explained below) for example
  to 5 minutes, the dynamic data stays unchanged for your
  visitors for this time. Also new added categories and
  images will not appear in the gallery until the cache
  files are invalidated and generated again.

  This means, if you change something in your gallery such as
    - add/edit images
    - add/edit categories
    - add edit usergroups and permissions
    - add/edit templates
    - change default language
  you must clean up the cache to ensure that your visitors
  don't see old data from the cache.

  It's also a good idea to generally clean up your cache
  from time to  time.
  This can be done manually with your favourite FTP-Client
  or with the Plugin "Clear Cache" from the Control Panel.

  Currently the following pages are cached:
    - The index page (index.php)
    - The categories pages (categories.php)
    - The top page (top.php)
    - The rss feeds (rss.php)

  In addition some internal data is cached.

  ----------------------------------------------------------
  How to enable the caching system:
  ----------------------------------------------------------

  1. Create a folder "cache" in the 4images directory.
     Ensure the the folder has write access (chmod 777).
     Its a good idea to protect this folder with a
     .htaccess file.

  2. Add the following variable to your config.php:
       $cache_enable = 1;

  -- Advanced control of the caching system ----------------

  You can control the caching system in your config.php with
  the following configuration variables:

  - $cache_enable = 1;
      A value of 1 enables the caching system, 0 disables it.
      Default value is 0.

  - $cache_lifetime = 3600;
      The lifetime of the cache files in seconds.
      Default value is 3600 (1 hour).

  - $cache_path = './cache';
      The path to the folder where the cache files will be stored.
      Its a good idea to move this folder out of
      your DOCUMENT_ROOT or protect this folder with a
      .htaccess file.

  - $cache_page_index = 1;
      A value of 0 disables the caching of the contents
      generated by index.php. Default value is 1.

  - $cache_page_categories = 1;
      A value of 0 disables the caching of the contents
      generated by categories.php. Default value is 1.

  - $cache_page_top = 1;
      A value of 0 disables the caching of the contents
      generated by top.php. Default value is 1.

  - $cache_page_rss = 1;
      A value of 0 disables the caching of the contents
      generated by rss.php. Default value is 1.
Return current item: 4images