Skip to content

Cache

We offer a cache system that significantly speeds up the operation of websites. It is intended as a replacement for the previously supported Varnish.

Configuration

OPTION cache

  • control - cache fully managed by headers (sent by the running application) such as Cache-Control, Expires, or Pragma
  • short - set cache to 1 second (microcaching)
  • long - set cache to 120 seconds
  • purge - clear cache
  • off - disable cache

OPTION cache_cookie

  • any - ignore cookies (page cached every time)
  • none - only requests without cookies
  • name - specify cookie name that can be used to differentiate users and serve them different cache versions

OPTION cache_debug

  • on - enable debug information
  • off - disable debug information

Devil

Command syntax:

devil www options DOMAIN cache control|short|long|purge|off
devil www options DOMAIN cache_cookie any|none|name
devil www options DOMAIN cache_debug on|off

DevilWEB

Cache options are also available in the DevilWEB panel: WWW websitesDetails for the selected page.

Examples

Here are a few examples of use:

  • For high traffic pages and no separation of content for users (e.g. blog without commenting, statistics page) - cache: long, cache_cookie: any.
  • For high traffic pages, with user login - but with content that rarely changes: cache: long, cache_cookie: USER_SESSION (e.g. PHPSESSID for PHP or sessionid for Django).
  • For pages with content that changes very often - e.g. forums: cache: short, cache_cookie: USER_SESSION (e.g. PHPSESSID for PHP or sessionid for Django).
  • For practically any application that controls cache using headers such as: Cache-Control, Expires, or Pragma - cache: control, cache_cookie: USER_SESSION (e.g. PHPSESSID for PHP or sessionid for Django).

Debug

When the debug_cache option is enabled, headers are added to each server response to inform about cache usage:

  • X-DCache-KEY: this is the exact key that was used to identify the cache.
  • X-DCache-Status: cache usage status: MISS, EXPIRED or HIT.