首页 > ATS核心, 使用, 常用功能, 配置文件 > to cache or not to cachei??a?�c�????a??a��e��e??

to cache or not to cachei??a?�c�????a??a��e��e??

2014年6月12日     浏览数:444 发表评论 阅读评论

to cache or not to cachei??a?�c�????a??a��e��e??

a??a?�a??cache???aS?a�????e??i??a��a??a?�e??cachei??a��a??a??a�?cachei??a��a??a?�e?�cachei??a��a??e??cachei??a��a??a??e??cachei??a?�c�????e?za??e?za??????��cs�e��e??i??a??a?�a???��a?????e??i??e�?a��?�?es?a��a��c��e�?i??e?�a??e??e??a??e�?a?�?�?a?�i??a?�c��???a?�e�scs�a?�a?�i??e?�e�???�a��a�?a�ZATS??�e?�???e�?e��i??e�??�?cs�e�?e�?e?�a?�a�?e��c�?a��

a?�c��i???��e�?a��a?�i??a?�e??a?�e??a??a??c?�c?�RFC2612c��a��a??a�?e��cs�RFC?��???i??

a�ZATScs�e�?e��e�?c?�e??e��

a?�cs�???aS?a�?a?se?�a??i??e�?a?�e??e�?c?�cs�e�?e��e�?c?�i??e�?a��?z?a??c�?cs�???ATScs�e�?e��e�?c?�i??cache?�?e????�e?�a??a?�?�??z?i?s

e?�a??e�?c?�a??a?�a??cache???aS?a�????e??i??e?za??a??a�?i??a?�???c��a???��??�RFCcs�??�a??e��e�??��a��a??c�???�???e??i?????e?za??a��a�?cs�e�?c?�i??a??a?sa�?cZ�a��a?�e��e??a��a??c�?cachec?�c�Yi???��??�a��a�?c��a?�?��???a??cs�i??

es?c?�a?�a??ATScs�a?�e�?i??????��a��a?????a�Si????�cs�a�?a?�cZ�a??a�?e?�a??a?Za�?i?Y??�e??a??e???SSa�?a?�cZ�a�Zc��a�?cs�50%i?????e�?a?�60%a�?i?YATSe?�a??a??a��i??a?�c��a??a�?a�Sa��a�?e��??�a��a��c��cs�a?�?z?a?�a?�i??a��a??a??a�?cachea��

?�???�http/1.1cs�e��a?�i??a??e��a?Se�?i??a??a�?cachecs�a??e?????e��??�??scs�i??a?�c��i????�e??cs�????�?a??c�?a?�cs�e?????e��??�??scs�i?�a��aY???�a?Sa?Ya??a��a?Za��a???�?e??cs�i?s

  1. e?�a�za�?e�?cache-control??Zc?�e��a�scs�i??a?�e?�cache
  2. ??�a?�???a��cs�i??e��?��?��cache

a?�c��i??a??e��a?�?�?a�scs�???a�sa?�a?�a?�a?�a?�e?�a??cachecs�a??a?�i?s

  1. a?�cookie??�a��
  2. ?????�body??�a��
  3. e?�a�zcS�?�?c�?>399??�a��i??e?�a�zcS�?�?c�?e?z?��a��??�a��
  4. a��a��a��

a?�c��i??e?�a?�c��RFCe�?cs�Musta�?Maya�?Must Notc��???cs�a?�??Zi??a��???a??e��a�?a�??��?��e?�c�?a?�a?�a?�e?�e�?c�?a�????cs�c�?i??c��a�??�?a??e??a?sa?�i??a??e��a�?a�??��a?scs�??�a?�a?scs�???Co-Advisora��a??a??w3ca?scs�a??a?�i???��e?�c�?a?�?????�a�?cs�i????�?��e?????a??i??a?Y??�a�?e??cs�a??a�?a??c??a??c�?i??a?�?��ATSa�?squide??a??c�?e?�a??c?�c�Ya??a?sa??e��?��cs�a�?a��a��a??e??e�?cs�?��e?�a�?e?Ycs�case??�?��a?�i????�a��a?Ya???��e?�a??e��a�?a�??��a�?TScs�aSYe?????a?�?��e?�a?�i????�?��a�?a?�Macaroon?��e?�??�?z�i??a?�c�?c??a?�c�?a?�a??e��cs�?��e?�c�?a?�i??a?�c��e?�a?�???a�?e??cs�a��

a��a??a?�e??cachei??c��a?�c?�

a?Se????�a��e??e?�i??e�?e��a?�ATS???a?�c?�a�?i??e?????e?�a�????c��cs�e?�a�zc��?z??Z�a?�cs�i??e�???�??�??�aY?c?�cs�?Z�a?�a��???a??c�?e?�a�zcs�header???c�??Z??Z�a?�i??e��??�a��???c?�c?�a��a?�??�??�aY?c?�cs�??�a��i?s

  1. cachecs�??�aY???�?Z�a?�i???Z�a?�cachecs�a�???????a��i?s

    records.configa?�??�a��a?�e�?c?�i?s

       # required headers: three options:
       #   0 - No required headers to make document cachable
       #   1 - "Last-Modified:", "Expires:", or "Cache-Control: max-age" required
       #   2 - explicit lifetime required, "Expires:" or "Cache-Control: max-age"
    CONFIG proxy.config.http.cache.required_headers INT 2
    

    e?�a??e�?c?� proxy.config.http.cache.required_headers ??�??Za?�cachee?�e�?cs�??Zc?�cs�header???a��a??

    • 0 e�??��??�???i??a??e?�??�a�sa��a?�a�?i????�a��e??a?scachea??a��a��i??e?�a??a?�?��a?�e?�a?se�?a??a?Ze??e�?a?�cs�???c?Sc?�a�?c��c�?a??c�?i?�i??cache?�?cZ�??�e�?i??a?�c��e?Ze��a?Y??�a��

      a��?z?a?�a????�??�a��e�?cs�c?�a�?a???��??�cs�a��a�?i??e?�a??a?�?��???a?�e?�cs�a��?�?a?�a�?c?�?Z?e??i??a?�c��a?�e?�a�????e?Ze��a��

    • 1 e?�e�?a?�??�i?sLast-Modified: Expires: Cache-Control: max-age a?�a??headera�?a?�??�a��a?�a??a��e?�a?????a??a?�i??a�?e�?a?�a??e?�?�??��a��a??a?�i?sLast-Modified: a�?a��a??a�?c?�a�?cs�a??ATSa?�a��

      ??�a??a??a�?e��a??c�?e?�a??a?�?��i??e�?a?????c?Sc?�a�?c��c�?i????�e??c��a???��e�sc?�c��a�?e?�?�??��a��a??a?�cs�CDNa??c�??�?a??a��

    • 2 a?�e?�a?�aS???Zc?�??�a�sc?�a�??��e�?i??a??a?�??� Expires: Cache-Control: max-agea?�a?�i??e?�?��cachecs�c?�a�??��e�??????Zc?�cs�a��e?�???e�?e��???a??i??a?Y?????�a???�?cs�???a??a��

      e?�a?????a???????�a??e��cs�i??a�Za?sc?�c��CDNcs�e��a?�i??a�Ze�?e��a��a�?e�?c?�a?�?�??�?????????�e??e?�e��cs�i??e��e?za?�e?za??a?�e�?a?�cs�c?�c��cs�a��a�?a��

  2. cachea?�i??a??a??e??a?sa�???�aS??�?cs�a��a�?i??a��a?�aS??�?cs�a��a�?a????�a?�???e�Yc�???�??�a�?c?�cs�i??e?�a?�a��a�?a?�??�e??a?�???a?�cookiecs�i??e�?e?�e??a?�e�Yc�???�??�a�?cs�a?�cookiecs�?��??�i?????cachea?�??�??�??�e?�e�?c�??�Scs�a??a?�cs�?��??�a?�a?�i??e?�?��a?Sa?�c�???�?��??�cs�a��a�?e��e??i??a��?z?c?�a�?a?�a??a?�e??c?�a�?cs�?��??�i??a��a?sa?�e��a??a��cs�c??es?a��

    records.configa?�??�a��a?�e�?c?�i?s

       # cache responses to cookies has 5 options:
       #   0 - do not cache any responses to cookies
       #   1 - cache for any content-type
       #   2 - cache only for image types
       #   3 - cache for all but text content-types
       #   4 - cache for all but text content-types except OS response
       #       without "Set-Cookie" or with "Cache-Control: public"
       # See also cache-responses-to-cookies in cache.config.
    CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1
    

    e�?c?�e?? proxy.config.http.cache.cache_responses_to_cookies a�?a�s???a?�c?�a�?a?�cookiecs�??????aS?a�?e?�a�zc��?z?i?s

    • 0 a??c?�a�?a��a?�a?�cookiecs�??????aS?a�?e?�a�zc��?z?

      e?�c�???�a��a?�?????�??�??�a��a�?cs�e�?e�?a��c��a?Ze�?a�sa?SCDNcs�c?�c��aYYa??a??c�?a???��a?�i??e�sa??aS??�?a��a�?a�?e?�?�?a��a�??��a??e��i??e?�?��aS??�?a��a�?a?�a�?cs�cookiea?s??�a??e?�?��cs�aYYa??a?�i??e��???aYYa??a?�cs�e?�?��e?????a?�cookiecs�i??c�se�????aS?a�?c�?a?sc��?��??�a��a�?Set-Cookiei??e?�c�?c��?z?a��a?sc��ATScs�c?�a�??�??z?e��????z?a��cs�a?�a�?a��a�Za��az�CDNcs�e??e??a?�i????�a��a??c???Z?e??a??c�?a?�c�?cs�aYYa??a?sCDNa��a�?a?�a?�i??a?�a???�??Z�a?�cookiecs�a??c�?i??a�?e�?e??a�?a??CDNaYYa??a?Sa??c�?cookiea��

    • 1 c?�a�?a��a?�c��?z?

      e?�a??e�?c?�e�Ya?Se??cs�e��e???�?a?????c��c�?a??i??a�Yc��a�Ya��e?�a��a??a��e�?c��a?Ya��????��??�cookie?��a?�e��???cs�c��?z?cs�a?�?��a��a��a?�???e�?a?Zcookiecs�?�?a??a??c�?a�?e?za??c?�a??c�?cs�??�a��e?????a�?a??cs�i??a?�e��cs�c��?z????a??a??e?�?��cs�a��a��?z?c?�a�?cs�e?????a�?c��a�?cs�i?????a�?a��a??a?�cs�e��e??i??a��?z????htmlc��a��a�?i??a??e??a��a?sa�?cZ�c��a?�a??a?�c��e??a?�?��es?a��

    • 2 a??c?�a�?a�?c��c��az�cs�c��?z?

      c�?a?????e??i??a??a��??�???aS?a�?e?Ya�?c��c��az�cs�e?�a�zc��?z?set cookiei???��a�?a??a??a�?c��c��az�cs�?��??�a??c�?cookiecs�a?�a�??????�e??a��a�?cs�a?�a??a?s??�i??e?�???a??a??a�?cs�a?�a??e�?c?�a��?Z?e??a�?e�?a??c�?a��

    • 3 c?�a�?e��a?�textc��az�cs�?��??�c��?z?

      c�???�a?Se??cs�a??a�?cs�a??c?�a�?a�?c��c��e??i??e?�e�?c??a?�??�e?�cs�c?�a�?e��a?�text(html)cs�a��a�?i??e?�?��a??a�?c?�a�?cs�a��a�?e??a�?a��??�e??cs�a��a?�i??c�?a??c?�a�?cs�?�?cZ�a?Ya��e�?a�sa?�a��e?�c�?e��a??a?�cs�???a?�a?�e?�e�?a?�e�?a��a?�?��i?????a?�?SShtml?��a��es�c��a��a��a�?a?�a�?i?Yi?Yi?Y

    • 4 c?�a�??��??�cs�e?ztextc��az�cs�e?�a�zc��?z?i??a�?a?Sa??a?� Set-Cookie a�???�a?� Cache-Control: publiccs�textc��az�cs�??????aS?a�?e?�a�zc��?z?

      c�?a??a?Se??e?�e?�a??c??a?�??�e?�cs�?�?a??i????�a��?�?a��c?�cs�?SS?�?a�scs�a??a�???�e??a��a�?cachecs�textc��az�i??htmli?�?��??�a?�a?�e?�???i???�???�e?�a?�c��?�?cZ�?�?a??a��a��c�?a?????e??i??e?�a??cs�a��a�??��a�?a?Se??e?�a??a?Ya��a??a�si???Z?e??e?�e?�c�???�a??c�?a��

    e��e?????i??a??a�sc?�c��a?�a?????e?za????�??scookiea?sa?�???a��a??i??a��a???��a��e??set cookiei??a��a???��a��a??a?�e??set cookiei??e?�a��e��???a??a�sa??a�sa��?��i??a��a��???a?�cs�a��a?sCDN?Z?a�?a�???�c?�c��cs�?��a��i??a?�e?�e�?e�Ya�???�a?sa??a�scs�??Ye�si?????c?�a��a?�cs�e��e??i??a??a�?e�??Z�a?�???cs�??�a��a?�i??e�?a??a??a��

    cache.configa?�cs� cache-responses-to-cookies ??�a��i??a��??�a???��cs�?�??z?i??a?�a��??�?�?e�?c��cs�?Z�a?�c��c�?c��a??i??a��a??c��a?�a�??�?a?�e??e??a??a�?a?Zc?�c��a��a�?e��a??cachee��a?�??�e�?e?�?��cs�c�???�a??c�?a��

c��a??c?�i??a��a??a??a�?cachei?Y

a?Se??c��a?�c?�a?�i??a??a��a??a?�e??cachea?sa?�??�aY?c?�cs�e????Zi??ATSe��a?????aS?a�???Zc?�??�a��cs�a??a�?cachecs�a��a�?e?????a?�e??e�?c?�a�?a?�???cs�a��e�?a??e��a?�e?�a?�a?�a��i??e????�a��a?????a??a�?cachecs�a�?i?Y

ATSc?�c�Ye�?e�?e��e��a??i??a??c?�a�?e�?e�?cs�?��a��i??e?�e�?e?�a??RFCcs�c?�a�si??a?Ye?�e�?c��a??a?�a�scs�e�?c��a?�a�?c??c�?RFCcs�e�?a?�i??a��?��ATSe�?e�?a?�a??a�sc�????a?�a�?e?�a?�cs�?Z�a?�c�?i??a?�e????�a��a�?a��a??a??a�?cachea??a?�c?????e????ZATScs�c��c�?e�?e�?a��a?�c��i????�a��e??cs�e?????c��a?�c?�a?�a��cs�e??e??a��

  1. ?????�a��a�?cs�e?�a�zi??a?Ya??a�?c?�a�?a��

    ??�c��RFCe��a�si??a????�headere�??????�a��a��a��a�?cs�e?�a�zc��?z?i??cache???aS?a�?a??e??c?�a�?a��e�???�a��e??e??a��e��???CDNa?�i??a????�headercs�??�a��e?????a??a�scs�i?s

    • e�?a??IMSe?�?��cs�304e?�a�z
    • c?�a�z?????�a��a��a��a�?cs�e?�a�zi??a�s?��???a?�c�?e?�e�?a�Sc��c��i??e?�c�???�a��a???��a??a��a��??�a��c�????a?sc�Ye�?c��cs�a?�a???????�e?�a�zc��?z?cs�URLa��

    a��?z?a�?e???�?a??a??e?�a?�?????�a��a�?cs�e?�a�z?��??�i??a?�a?sa?�a�?a�?a?�cZ�a�?a?Sa�z???e?z?Z??��e�?a�???????aS?a�?cs�aZ�aS�c��i??e?�a?Ya?????a?�a??a��az�cs�CDNa????�c?�a?�cs�a��a��?��ATSe�?e�?a?�a?�a?? proxy.config.http.cache.allow_empty_doc e?�a??a?�?��i??e�?e��a??0i??e�?c?�a??1a??a�?a??aS?a???????�?�?a??e?�a�za��a�?cs�c��?z?e?�e??c?�a�?a��a?�c��i??a??c�?e?�a??a?�?��a?Ya??e??e????Zi???��??�cs�????�?a??a��a�?cs�c��?z?e??a?se?�c?�a�?i??c?Y?�????a?????c?�a�?a?Ye?�e�?c?�a��a��???a��i????�a��c��a?�c?�a?�e??cs�a?�a?�e��a?�i??a�?a?Sa?Ze??cs�a��a��???a��a��

  2. e��e??cs�c��?z?i??a?Ya??a�?c?�a�?a��

    e��e??cs�c��?z?c?�a�?a??a?�i?Yi?Ye?�a??e��e??a?�c�????a??a�sa??e�?e�?cs�e??e??i??a�s?��e?�c�???�?????�a?�e�?a�???�?????�?�?a?�cs�e�?e�?e??a?se��a?�a?�a??e??i?sIt dependsa��??�a��e?�e�?a?Y???a?�?��cs�i??a��?��a?Ya��???a??a�sa?�a?�a??recordsa?�?�� proxy.config.http.negative_caching_enableda��

    ??�a��a�?e��i???�Ze�?e�?e��a??c�?e?�a??c?�a�????a?�i?s

    • a�?e��e�?c?�a?�a??a??a�?cs�?��e�?c�� negative_caching_lifetime a?�?��a�?a?�c?�e��e??a?�a�?cs�e?Ye??a?�a�?a��
    • e?�e�???�a??a?�cs�???a?�i??a��a��e��???a?�?��i??revalidatei?�a��a�?cs�e??aS�a��

    c�?a??e?�a??a?�?��i??a?????c��a��e��????��es?e??a??c��?z?c�???�a��e?za????�a?�aS�a��a?�c��i??a��?z?c�?e��a?�i??e�?a?s?�??�?a��a��

  3. rangecs�a��a�?a?Ya??a�?c?�a�?a��

    ??�c��RFCe��a�si??Rangea�z???cs�e?�?��i??e?�a�zcs�a��a�????a??e??c?�a�?cs�a��a?�???i??a??ATSe?�?��cs�e??c��i??a?�c��a?sa??e?�a??a??a?�a�?a�?a?�cZ�cs�e��e??a?�e��??�???a��a??TS?�?a??e�?i??e�Yrange??�a�?c?�cs�a��a?�a??a?�?��i?sproxy.config.http.cache.range.lookup a�? proxy.config.http.cache.range.writei??e?�a?�a??a?�?��e�?e��e?????a?�a??cs�a��a��a?�c��i??e?�a?�a??a?�?��a?�a???Z�a?�rangecs�e?�?��?Y?a???Y?cachei??a?�a?�a???Z�a?�rangecs�e?�?��???a?�e??a�Ya??a??a??cachecs�e?�?��a��e??a??e�Ya��a��???a�?a�?c?�a�Si??a?�?????�a��a��a?�i??e?�a??a?�c�?a��?�????a?�a��e�??�?a��a?�?�?RFCa??rangecs�a��c?�c��c�????a??c??es?i????�a��c�???�c�?a?�cs�???rangei????????aS?a�?a�?a�?a??a�?c��a?�a??200cs�c��?z?a�Sa��

    a��a�zi????�??�??�??�c�?cs�i??a?????e?�a?�a??a?�?��a�?a�scs�a��e�????c��a??a?�c��c?�a�?cs�e?�c�??�??z?i??e?�a??c��a�?a?????a?�a??a��a??cs�???a?�a��i?s?��a?�e?�?��a??a�?a?�c�� ATS wikie�?e�?cs�???a?sa?�a��

  4. a�???�c�?a?�no-cachecs�a?Ya??a�?c?�a�?

    a�???�c�?a?�no-cachecs�??�a��i??a�s?��???e?�e??a??a?�a?�?��cs�??�a��i??e?�c�???�a��a?�i??a��?z?a�?e??a�z???a?sIMSa?�?��cs�e??i??a?�a�za?Sa?�e��???a??a�?cs�a��a??a��e��???CDNe�?i???Z�a?�a��a�?cs�a?�?��i??a?�a�s???e?�e�?a?�a???�?a???�?cs�???a?�i??e�?e??a�?c�???�cs�e?�?��e??a�Yc�??Z?a?�?��a?�???c��aZ�a��a��?��ATSa??a�???�c�?a?� no-cache cs�??�a��i????�a??a?�?�� proxy.config.http.cache.ignore_client_no_cache a??a�??Z�a?�a��a??c�?a?Zi??a�???�c�?cs�no-cachea??ATS????��?�?cs�a��

    e?za??a�?e��e?�a??e�?c?�a??c�?i??a?�c��i???�?a�?e��?�?e�??�?cs�c�?c?�cachea��a�?i??a�za�???�a��a�?a?�a?�c��cs�e??e??e�?e�?a��a?�???e�?a��a�?c�?c?�cs�a???Z�?��a��

  5. ???aS?a�?c�?a?�no-cachecs�a?Ya??a�?c?�a�?

    OKi????�a��a�?c�?cY?e?�a�???�c�?cs�no-cache?????�a??a??c�??Z�a��i??e�?a?????aS?a�?c�?a�?i?YATSa??a?se�?c?�cs�?��a��i??a??a�se????????aS?a�?a�?a�???�c�?a??c��e�?e�?i???��a�?ATSa?????aS?a�?c�?a?Y??�a?�a??a??c�? no-cache cs�e��e?? proxy.config.http.cache.ignore_server_no_cachei??a?�c��e?�a??a?Ya��???a??c�????aS?a�?c�?cs�no-cachea��a��

    a??a??CDN???e??i??a??c�?serverc�?a??cachecs�?Z�a?�c�?a??a?????a??a??a?�?�?i???��a�?e?�a??a?�?��e�?e��???a�?e��cs�a��??�a��c�?a??i??a?�a�?c�???Zc�?a?�a��a?�cs�e?�c?�i???�?a??c�?e?�a??a?�?��cs�a��

  6. a�???�c�?a?�cc-maxage=0cs�a?Ya??a�?c?�a�?

    http/1.1a�?a?Zi??a�???�c�?a?�?��cs�??�a��a?�i???�?e�?a�?a�s?��???a?�e�?a?�a?? cc-maxage=0 cs�?Z�a?�???a?sa??a?�cachea?�?��i????�cs�?�?e�?a�?c�se�??SSe?�a??a?�?��a�? no-cache a?�c�?a��??�a��a??a?�e?�a??a?�?��i??a?�e??a?se?�e�?a??a�???�c�?cs� no-cache a?�?��cs�a??e�?a��c?�a��

  7. a�?a?ZIMSe?�?��

    a�?a?ZIMScs�e?�?��i????????aS?a�?c�?a?s??�a?�c�???�a��i?s

    • ??????aS?a�??��??�????�?a??i??e?�a�z304cs�c��?z?
    • ??????aS?a�??��??�??�?�?a??i??e?�a�z200cs�c��?z?

    a??c??a?�cs�CDN???aS?a�?a?�i??IMScs�e?�?��i????�e��e??cachec�?cs�304cs�c��?z?i???��e�????c�?a?�a??e��cs�a��?SSe?�e??a?�e?�?��c?�a�?e��???i??e??a�Y???e��cs�???a?�cachecs�?�?cZ�a��?Z�a?�e?�e�?cs�a�?e��???a?Se??c��a?�???a��

    a?�c��i??a��?z??SSa?�a?�a�???�c�?cs� no-cache c��e?�a??a�z???a?sIMSe?�?��i?????a?�a??a�??z?a��cs�a�?a��a??a?�e�?cs�a�z???a?�a�??�?e��a�?i?Y??�c�Ya?�a?????e�?a?�a��a�?cs�i??a?�a?�a?????e�?a?�?��??�cs�i??a��e�????a??a��cs�a��ATS??�a?�a??a?�?��i??a??a�??��a?�e?�a??aSYe?? proxy.config.http.cache.ims_on_client_no_cache

    e?�a??c?�e��????�?a?????a?�a??a?�e�?cS�?�?cs�e�?a�??�????a��

?��a?�i??ATSa??a??a�?cache?�?e??i??a�?c�??��a��cs�c�?a?�cs�a�???�a?�a��e�?a??c�?a??e?�a?�aSYe??i???�?e??a�Ya?�???a??ATScs�?�?cZ�a��

c��a?�c?�i??a��a??a?�e?�cache

??�a��a?scachei??a?sCDNi??a��???e�?a�?a?�a??c�?a�?e��e??i?s???e�?c�???�?�Ya?�a�?e�?a?Z?????�a��e?�a?�a??c�?a�?e��e??i???��e�??�Za??a??a?�i??e??a?se??a?�???e�?cachea�?a?�cZ�i?????e�?cachea??c�??�?cZ�a?S???a��e?�a��???

  1. a��e��????�?e�?cs�a��a�?
  2. a��e��???e?�?��e�?cs�a��a�?

c�?a�?e��e??c�?a�?e�?a�?i??a�Zmisscs�?�?a?�a?�i??a?�?z?misscs�e��e??i???????�??�??�??�?�?cs�a?�e�Ye�?a�??�????a��a��a?�a?�cZ�ATSa??a��a??a?smissa�?i?Ya??a��a?Zcachecs�?Z�a?�i?????c�?a�?TSc�?i?�??�cachecs�a�?a�?i??c�?e�?a�????c��c��i?�

a?�a��i?s
ATSa?sa??a??a??cs�Accept-Encodinga�?e?�e??a�?a��c��a??a??e�?i???�?a?se?�a�zc��c�???�a???��cs�c��?z?a��c��e�?i????�a��cs�a�???�c�?a?�a�????cs�AEa�?i???????�a?�a??a?Y??�a��c�?i??e?�a��e��???a??a�sa??a�sa�?a�?c�?e�?cs�?�?e??a�?a?Sa??e�?a??a�?a?�i??c�se�?a?sc�??Z?e??a?�??�a��a�???�?��c��CONFIG proxy.config.cache.limits.http.max_alts INT 5e?�e�?e��e�?c?�a??5i??e?�?��i??a��?z???�?��cs�a�???�c��a?ZAEa�?a??a??e�?i??a��a?se?�?Z�a�?c�?a�?a�?cs�5a??a?�cs�a?�a??i??c?�a�?e?�a�?cachec?�c�Ya��e�?e�Sa�scs�AEc��a??i??a��a?se��???e�Sa�scs�?�????a�?missa��

?�Za???��a?�?z?e?�c��e��e??a�?i?Yi?Y

cachecs�e��e??e??a??a�?c�?http_uics�cache??�?Y?a�?a��???c?�i??e?�a??webc�?e??cs�a�?a��i??a??a�?c�??Z?c��a?�a?�a�?cachecs�?��??�a�???�cs�e?�c��e?�?��a�?a�?e?�a�za�?a�?c?�a�?body?��??�a��a�?a�?a?�a�?a?�?�??��e�?c��c��e?za??detailcs�a?????a��e�?a???�?a?�missa?�?z?c?�a�sc�?a�?URLa?Zi??a��?z????cachecs�e��e??i??a��a??a�?c�?e?�a??a?�c��c�za?�a��a?�cs�http_uia�?a��???a?�?z?a��a��

a��a?�e�?a�?e��e??i?Y

ATSe�?c��a�?c�????a?�e?�a??e��e??a��i??c��a�??Z?e??cs�e�?a�??�????a��???c��a?�c?�?s?cs�???a??i????�a��e??cY?e?�c��a�???�e�sc�?cs�AE?�?a?????gzipi??e�??SSAEc��a?�???e�?a??gzipi??e�?a??a??gzipa��c��a?�a?�i?s

CONFIG proxy.config.http.normalize_ae_gzip INT 1

a?�c��i??a��?z?a?�??�?�?a�scs�AE?�???�e?�e�?a??c��i??a??a�?a�?e�?a��a��??�a��???a�????e?�a??e?�?��a��

ATSa�?c�?a��e?�a?�aY?c?�cs�?�?e??i??a?sa?�a??a�scs�e��e??i?s

proxy.config.http.cache.ignore_accept_mismatch
proxy.config.http.cache.ignore_accept_language_mismatch
proxy.config.http.cache.ignore_accept_encoding_mismatch
proxy.config.http.cache.ignore_accept_charset_mismatch

e?�a?�e?????a??a�?e��a?�c��a?�c?�?s???�?�??z?cs�??za�se?�a?�???a??cs�e��e??i??a?�c��i??a?Z?z?e�?a��e�???�??sa��a��

anywayi???�?a�?a?�cs�?��??�??�e?�i??a?�?z?misscs�??�a��i??a?�??za�sa�?a��a��a?�c��a��?z?a�?c??a?�i??a?�c��a?�a?sa�?e?Y??za?�a��

c��a��c?�i??a��a??e??cache

e?�a??e??e?????a?�a??a?�?z�cs�a??e??c��i??e??c?Ycs�a??e??c?Ycs�e??a??a�?a?�a?�?z�i????�a��a??a��ATSe�?e?�???e??a?�

  1. a��a??e??e??cache

    • ???c�?a?�a?????e????�a????�??scs�?Z�a?�i??c�se�??Y?a?�?��a��???c�??�?e��???a??e?�c?�i???�Za??aSzi?Yi?Y

      a?�c��i??e?�c�???�a��??�a??cs�e�?a�?aSz??�???e�Y???c�?a?s??Ye�si??e�??�?cZ�cs�CDN?z�?z�i??a?s?SSaS??�?a�?e?�?�?a��a�?a?sa??a?�a�?i??a�??��???c��a?�cs�a?�a�?e??a?se��ATSc?�c�Ya?scachea???�?a??a��

    • ???c�?a��???a??e��cachei??e�?a?�cY?e?�a�?a��a?�e??e?�cachea???�Za??aSzi?Y

      c�?a??cs�ATSa?Ya??a�?a�Si??cache.confige�?aS�a??a??a?�cs�?Z�a?�a��a??a?�a��

  2. a??a??TS?�?a??a??e??i??a?�a?Ya??a�?e�?a��a��??�a��e��a�?e??

    • Rangea�z???cs�i??a?Ya??a�?cachei??a?�a??a�?a��??�a��a�zcZ�a��a?�aSYe??i?s

      1. ?SSRangea�?aZ�?Z�a�?a�z???
      2. ?SSRangea�?aZ�?Z�a�z???i??c��a?Ztransforma?�c��c��a�???�c�?
      3. ?�?e�?a��a?Scs�???Rangea?�c��a�z???i??Rangea?�c��c��a�???�c�?i??e??a??a�?a��
    • ?�?a?�a?�i????�e??cs�???c?Y?�?cs�?�?a?�a?�i??a��rtmp rtsp rtpa??e��c��a��???a?�a???�?a?�a?�e�?a�??�???????ATSc��a?�?��a??cs�a��

    • p2pi?sp2pa?Ya??a�?c�?protocol??�a��?????za�si??a?�a?�a??a�?a??c�?ATScs�a�?a�?a��

??�a?Za??e�?i??a��a??a??e??cache

  1. ?��a?Sa?�c�???�cs�a??a???��??�cs�
  2. a?sa?�a�?c�???�a??c�??�Ya?�cs�
  3. ??�??�a?�e?Ze��cs�

a��a�zi??a��???a?sc��a?�e��???e?�c?�cs�i??a?scachea��???e�?e�?e�?a�Si???SSe�?a��a?�a?�a?�e�?aZ�?????�a????Z?�?cs�a?�a��

  1. nbox
    2014年7月11日19:41 | #1

    大师布道了!

  2. Aries
    2015年11月21日01:54 | #2

    博主你好,

    我最近在解决国内用户访问国外网站延时的问题。
    现在我有一个服务器在德国,国内有一个ATS服务器,配置大概是10G disc cache+1.5G memory cache,现在cache hit ratio大概是38%。

    record.config里面我已经设置了
    CONFIG proxy.config.http.normalize_ae_gzip INT 1
    CONFIG proxy.config.http.cache.ignore_accept_mismatch INT 1
    CONFIG proxy.config.http.cache.ignore_accept_language_mismatch INT 1
    CONFIG proxy.config.http.cache.ignore_accept_encoding_mismatch INT 1
    CONFIG proxy.config.http.cache.ignore_accept_charset_mismatch INT 1

    但是当我通过浏览器打开cache state(通过开启http_ui_enabled)搜索我要查看的url,发现这个url有20个alternative,我把max_alts设置成20,但是每个alternative的request header除了我上面record.config里面设置忽略掉的以为,就只有主要是User-Agent不同了。

    是不是ATS会对每个不同的User-Agent缓存一份文件,这样下来不有太多的同一份文件,多个copy了?

    能不能通过设置让ATS忽略User-Agent或者其他的Request Header,让每个文件都之保留一份alternative,因为我网站的99%的内容都是可以缓存的。

    谢谢。

  1. 本文目前尚无任何 trackbacks 和 pingbacks.