What can I cache with Varnish Cache?

I know you can cache images, but what else can I cache?

Varnish Cache can cache a file of any type. Here is a list of a few file types that can be cached:

Fonts:

  • woff
  • ttf

Images:

  • png
  • jpg
  • jpeg
  • gif
  • ico

Javascript and CSS:

  • css
  • js

Documents:

  • html
  • pdf

However, you will only want to cache static files. You will not want to cache files that have dynamic segments. For example, if your HTML file contains a form with a CAPTCHA security question, the CAPTCHA image for that form is generated every time a user requests that HTML document. If this file is cached, your users will not be able to authenticate themselves because the CAPTCHA image they are viewing is incorrect for that particular user and they are actually viewing an image cached from a previous user.