使用查询字符串从URL缓存 [英] Caching from URLs with a query string

查看:91
本文介绍了使用查询字符串从URL缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理的网络应用程序使用/image?name=a.gif等网址提供图像。页面加载缓慢部分是因为浏览器没有缓存图像。

The web application I'm working on serves up images with URLs like /image?name=a.gif. Pages are loading slowly partly because browsers are not caching the images.

是否有任何http标头组合可以说服IE缓存图像,即使URL有查询串在里面?我试图避免浏览器发出任何不必要的请求(包括if-modified-since类型请求)

Is there any combination of http headers that will persuade IE to cache the images even though the URL has a query string in it? I'm trying to avoid the browser making any unnecessary requests (including if-modified-since type requests)

我对使用IE的解决方案很满意(6 +)仅。另外,我知道我可以通过URL重写来避免这个问题 - 我只是想更好地理解浏览器缓存。

I'm happy with a solution that works with IE (6+) only. Also, I know that I can avoid the problem by URL rewriting - I'm just interested in understanding browser caching better.

谢谢

推荐答案

设置 expires header 在您的网络服务器上到某个遥远的日期。

Set the expires header in your web server to some far away date.

这篇关于使用查询字符串从URL缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆