zoukankan      html  css  js  c++  java
  • QQ群web前端分析一——准备部分

    Vary:Accept-Encoding的用途  

    2012-09-06 11:47:08|  分类: rhel_apache|字号 订阅

     
     

    查看网页的response header一般都有Vary头(服务器支持压缩的都有),意思是说squid要把客户端传来的某个头区别对待,譬如Vary:Accept-Encoding,客户端发来Accept-Encoding:gzip(MSIE), deflate时squid会为gzip, deflate做一个存档;如果客户端没发来Accept-Encoding这个头(wget),squid又会为无Accept-Encoding做另一个存档;这两个存档的内容是不一样的,gzip, deflate的是压缩后的内容,一堆乱码,无Accept-Encoding的则是网页源码。

    知道了Vary的原理,剩下的事就容易了,在网页输出时加上Vary:User-Agent,意味着squid要为每一种User-Agent存一个存档,nginx里这样配置即可:

    add_header Vary Accept-Encoding;

    这时网页的response header会有Vary:

    Vary:Accept-Encoding;

    引用出处:http://zhumeng8337797.blog.163.com/blog/static/10076891420128611478976/

    Squid: Optimising Web Delivery

    Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL.

    SQUID是个缓存代理服务器

  • 相关阅读:
    hdoj5813【构造】
    Codeforces645B【树状数组求逆序数】
    pojcoin【未完待续】
    hdoj5818【模拟】
    poj2385【基础DP】
    poj3069【贪心,水】
    谦虚
    poj3617【贪心】
    poj2229【完全背包-规律Orz...】
    poj3176【简单DP】
  • 原文地址:https://www.cnblogs.com/jamesldj/p/3338041.html
Copyright © 2011-2022 走看看