Why nginx does not cache my content?

前端 未结 2 774
梦如初夏
梦如初夏 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: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;
    

提交回复
热议问题