Fortinet black logo

Administration Guide

FAQ

How to enable Caching?

Follow the steps below to enable web cache for a server policy in Reverse Proxy, TTP or WCCP modes:

  1. Enable Web Cache in System > Config > Feature Visibility;
  2. Enable Web Cache when creating or editing an HTTP server policy in Policy > Server Policy, then a web cache policy will be automatically created in Application Delivery > Caching;
  3. You can click the icon View Configuration besides the Web Cache option in the server-policy edit page, or visit Application > Caching to edit the configuration of a web cache policy;
  4. In the Edit Web Cache Policy page, click Create New to add one or multiple web cache rules.

Notes:

  • Web cache rule is a MUST, otherwise the web cache policy will not be matched;

  • If multiple rules are configured in one policy, then these rules will be matched in order. That is to say, when the first rule is matched, the other rules followed will be skipped and not take effect any more.

What can be cached and what cannot be cached?

Caching generally works best with data that doesn't change. Things like static web pages, images, movies, and music all typically work well.

FortiWeb will NOT cache responses if the request:

  • Has fields such as Cache-Control: no-cache/no-store/; Pragma:no-cache

  • Contains the header:

    • Authorization

    • Proxy-Authorization

FortiWeb also will NOT cache if the response:

  • Has a Set-Cookie: field

  • Has a Vary: fied

  • Has fields such as Cache-Control: no-cache/no-store/private; Pragma:no-cache; Cache-Control: max-age=0

  • Proxy-Authorization

  • Connection

  • Keep-Alive

  • Proxy-Authenticate

  • TE

  • Trailers

  • Transfer-Encoding #So Transfer-Encoding: chunked is NOT supported

  • Upgrade

What does Key Generation Factor in Web Cache Rule mean?

Subsequent visits will match the cache rule only if all key generation factors in the request are the same as the request/response that has been cached.

For example, if both Host&URL are selected in the Key Generation Factor, then a request with a different Host will not match the cached content.

Cookies can be enabled in Key Generation Factor > Cookies with a specific cookie name configured in Add Cookie Name, which allows caching a response when the request header includes “Cookie: <name>=<value>”.

What is the maximum size of a file that can be cached?

The maximum of a single file that can be cached is 8 MB.

FortiWeb uses the header Content-Length to identify the size of the entity-body. If the Transfer-Encoding is chunked, the content will not be cached.

How to enable Caching?

Follow the steps below to enable web cache for a server policy in Reverse Proxy, TTP or WCCP modes:

  1. Enable Web Cache in System > Config > Feature Visibility;
  2. Enable Web Cache when creating or editing an HTTP server policy in Policy > Server Policy, then a web cache policy will be automatically created in Application Delivery > Caching;
  3. You can click the icon View Configuration besides the Web Cache option in the server-policy edit page, or visit Application > Caching to edit the configuration of a web cache policy;
  4. In the Edit Web Cache Policy page, click Create New to add one or multiple web cache rules.

Notes:

  • Web cache rule is a MUST, otherwise the web cache policy will not be matched;

  • If multiple rules are configured in one policy, then these rules will be matched in order. That is to say, when the first rule is matched, the other rules followed will be skipped and not take effect any more.

What can be cached and what cannot be cached?

Caching generally works best with data that doesn't change. Things like static web pages, images, movies, and music all typically work well.

FortiWeb will NOT cache responses if the request:

  • Has fields such as Cache-Control: no-cache/no-store/; Pragma:no-cache

  • Contains the header:

    • Authorization

    • Proxy-Authorization

FortiWeb also will NOT cache if the response:

  • Has a Set-Cookie: field

  • Has a Vary: fied

  • Has fields such as Cache-Control: no-cache/no-store/private; Pragma:no-cache; Cache-Control: max-age=0

  • Proxy-Authorization

  • Connection

  • Keep-Alive

  • Proxy-Authenticate

  • TE

  • Trailers

  • Transfer-Encoding #So Transfer-Encoding: chunked is NOT supported

  • Upgrade

What does Key Generation Factor in Web Cache Rule mean?

Subsequent visits will match the cache rule only if all key generation factors in the request are the same as the request/response that has been cached.

For example, if both Host&URL are selected in the Key Generation Factor, then a request with a different Host will not match the cached content.

Cookies can be enabled in Key Generation Factor > Cookies with a specific cookie name configured in Add Cookie Name, which allows caching a response when the request header includes “Cookie: <name>=<value>”.

What is the maximum size of a file that can be cached?

The maximum of a single file that can be cached is 8 MB.

FortiWeb uses the header Content-Length to identify the size of the entity-body. If the Transfer-Encoding is chunked, the content will not be cached.