Troubleshoot for caching issues
There are several methods for troubleshooting if a URL is not cached as expected:
-
Check web cache configuration;
Examine if the specific headers of the request match the cache rule: Host, Path/URL, HTTP Method, Return Code, File Type and Key Generation Factors.
-
On 7.0.2 & later builds, click the button Test to check if a URL can hit the web cache:
- On 7.0.2 & later builds, when cached content is hit, there will be statistics in Dashboard > Status > Throughput:
-
On 6.3.x & later builds, you can also check if the Requests (Cache Hit/Total) count increase.
However, this count usually has time delay (max 15 minutes) after the cache is hit.
-
Check if the response is replied by FortiWeb or the back-end server.
On 7.0.0 & later builds, you can also check if the Requests (Cache Hit/Total) count increase.
On 6.3, you need to capture packets on FortiWeb and check if the new request is sent to the back-end server. If a request is not sent to the back-end server while the client can receive the replay, cache content should be hit. -
You can also enable diagnose logs to check more processing details or collect information for further analysis.
FWB # diagnose debug flow filter module-detail web-cache 5
FWB # diagnose debug flow filter flow-detail 0 # availadble since 7.4.1
FWB # diagnose debug flow trace start # available since 7.4.1
FWB # diagnose debug enable
Example for a successful cache hit:
[web cache][DBG_H](./waf_module/web_cache.c:3973): web_cache_process: begin
[web cache][DBG_H](./waf_module/web_cache.c:3141): process_web_cache_s2c_hash_table: begin
[web cache][DBG_H](./waf_module/web_cache.c:3145): process_web_cache_s2c_hash_table: WEB_CACHE_CACHE_HT_HIT in response
[web cache][INFO](./waf_module/web_cache.c:3148): process_web_cache_s2c_hash_table: The WEB content is from WEB Cache!
[web cache][DBG_H](./waf_module/web_cache.c:281): req_match_single_rule: match web cache rule success : /
Example for cache hit failure:
[web cache][DBG_H](./waf_module/web_cache.c:3973): web_cache_process: begin
[web cache][DBG_H](./waf_module/web_cache.c:3141): process_web_cache_s2c_hash_table: begin
[web cache][DBG_H](./waf_module/web_cache.c:3168): process_web_cache_s2c_hash_table: WEB_CACHE_HT_PREPARE_CACHE in response
[web cache][INFO](./waf_module/web_cache.c:3170): process_web_cache_s2c_hash_table: The WEB content is from Physical server!
[web cache][DBG_H](./waf_module/web_cache.c:281): req_match_single_rule: match web cache rule success : /