Answer the question
In order to leave comments, you need to log in
How to know that Nginx is caching dynamics?
Used Nginx+php-fpm. Site on Drupal. Set up Nginx to cache page dynamics. How to check if Nginx is using its own cache or using Drupal's cache? The page headers do not change, only the page load time during caching changes, for the better.
Confuses this header:
X-Drupal-Cache:HIT
Answer the question
In order to leave comments, you need to log in
Set the log format for caching and watch with your favorite standard means)
http {
log_format cache '$remote_addr - $remote_user [$time_local] $request '
"$status" $body_bytes_sent "$http_referer" "$host" '
'"$http_user_agent" "$http_x_forwarded_for" "$upstream_cache_status" '
'"$upstream_addr" "$upstream_response_time" "$request_time"';
...
server {
access_log /var/log/nginx/access.log cache;
...
}
}
tail -f /var/log/nginx/access.log |grep -e '"HIT"'
Try to search manually in the directory with the cache:
where /nginx/proxy_cache_path is the directory with the cache specified in the nginx config,
your_links is the part of the url of the page that should have been cached.
You can disable php-fpm and try to pull the supposedly cached resource :D
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question