ninqq
V2EX  ›  问与答

nginx cache 如何让登录的用户忽略缓存啊

  •  
  •   ninqq · Oct 28, 2014 · 3326 views
    This topic created in 4249 days ago, the information mentioned may be changed or developed.
    虽然可以让登录的用户不缓存,但是一旦其他用户(游客)访问进行缓存下来了,登录的用户访问就会读取缓存的数据,
    不知道能不能让登录的用户(带cookie?)忽略缓存数据
    2 replies    2014-10-28 23:21:14 +08:00
    iCodex
        1
    iCodex  
       Oct 28, 2014
    对动态的页面进行缓存是愚蠢的行为。但总归是要面对。
    那就直接pipe掉~ 缓存不作处理。

    proxy_cache_bypass $cookie_nocache $arg_nocache $arg_comment;
    proxy_no_cache $cookie_nocache $arg_nocache $arg_comment;
    proxy_cache_bypass $http_pragma $http_authorization;
    proxy_no_cache $http_pragma $http_authorization;
    proxy_cache_bypass $skip_cache;
    proxy_no_cache $skip_cache;

    more: http://nginx.com/resources/admin-guide/caching/
    notsobad
        2
    notsobad  
       Oct 28, 2014
    proxy_cache ui-proxy-cache;
    proxy_cache_bypass $cookie_user;
    proxy_no_cache $cookie_user;
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1154 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:55 · PVG 01:55 · LAX 10:55 · JFK 13:55
    ♥ Do have faith in what you're doing.