如何configurationsquid直接检索(和caching)我的静态资源?

我在CentOS EC2 VM上运行Apache / Tomcat / Spring tc服务器。

我想在同一台机器上安装squid作为代理,直接检索(即不需要将请求转发给Apache / Tomcat)并caching仅由URIs / images,/ css或/ js标识的静态内容。

其他URI应该被转发到正常的Web服务器,而不是被caching。

由于我是一个新手,我没有从鱿鱼文件find如何configuration鱿鱼这种所需的行为(如果甚至可能)。

你能帮我,告诉我如何configuration鱿鱼为此目的?

谢谢。

默认情况下,它会caching所有的静态内容谓词

hierarchy_stoplist cgi-bin ?

默认情况下是打开的,目的是防止dynamic页面被caching。

你可以像下面这样创build一个acl:

 acl static_content urlpath_regex ^/images acl static_content urlpath_regex ^/css acl static_content urlpath_regex ^/js 

然后像这样申请:

 no_cache deny !static_content 

未经testing