Why nginx does not cache my content?

前端 未结 2 752
梦如初夏
梦如初夏 2021-01-18 21:19

I checked the cache path /usr/local/nginx/proxy_cache. No cache file found after I visit some url many times.

My configuration: ngnix.conf

http {
            


        
相关标签:
2条回答
  • 2021-01-18 21:34

    You should turn on error logging, and then take a look at that. I had a similar problem with the fastcgi cache, and the issue was the folder permissions.

    0 讨论(0)
  • 2021-01-18 21:37

    nginx does not cache pages which sets cookies, Check if your pages have a Set-Cookie header.

    If necessary, cookies can be ignored with proxy_ignore_headers and suppressed with proxy_hide_header. For example:

    proxy_ignore_headers Set-Cookie;
    proxy_hide_header Set-Cookie;
    
    0 讨论(0)
提交回复
热议问题