10. Cache

  1. HAProxy provides a cache, which was designed to perform cache on small objects
  2. (favicon, css...). This is a minimalist low-maintenance cache which runs in
  3. RAM.
  4.  
  5. The cache is based on a memory which is shared between processes and threads,
  6. this memory is split in blocks of 1k.
  7.  
  8. If an object is not used anymore, it can be deleted to store a new object
  9. independently of its expiration date. The oldest objects are deleted first
  10. when we try to allocate a new one.
  11.  
  12. The cache uses a hash of the host header and the URI as the key.
  13.  
  14. It's possible to view the status of a cache using the Unix socket command
  15. "show cache" consult section 9.3 "Unix Socket commands" of Management Guide
  16. for more details.
  17.  
  18. When an object is delivered from the cache, the server name in the log is
  19. replaced by "<CACHE>".