if-modified-since问题(协议问题?) [英] if-modified-since question (protocol problem?)

查看:56
本文介绍了if-modified-since问题(协议问题?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[最初发布于alt。 www.webmaster ,有人建议这个ng

可能是一个更好的地方。]


我已经更新了我的测试服务器来处理if-modified-since。我注意到

(我运行的旧版本)IE和Netscape似乎永远不会发送

if-modified-since。但奇怪的是,Opera发送了

if-modified-since但是当我回复HTTP / 1.0 304 Not Modified时它没有从它的缓存中刷新屏幕,它离开了屏幕

空白。


我只能得出结论或者我没有返回正确的协议

序列,包括HTTP / 1.0 304 Not Modified,或者旧的Opera

我正在运行包含一个bug。我打赌我的代码在

中的错误回答。


任何人都有处理if-modified的经验 - 因为他们自己和

做得好吗?


-
http://www.ren-prod-inc.com/hug_soft...action=contact

[originally posted in alt.www.webmaster, was suggested that this ng
could be a better place.]

I''ve updated my test server to handle if-modified-since. I''ve noticed
that the (old copies I run of) IE and Netscape seem never to send
if-modified-since. But the strange thing is that Opera sends
if-modified-since but when I reply with "HTTP/1.0 304 Not Modified" it
is not refreshing the screen from its cache, it is leaving the screen
blank.

I can only conclude that either I am not returning a correct protocol
sequence including "HTTP/1.0 304 Not Modified", or that the old Opera
I''m running contains a bug. I''m betting on the incorrect response in
my code.

Anybody have experience with handling if-modified-since themselves and
doing it properly?

--
http://www.ren-prod-inc.com/hug_soft...action=contact

推荐答案



hug写道:

hug wrote:
[最初发布于alt。 www.webmaster ,有人建议这可能是一个更好的地方。]

我已经更新了我的测试服务器处理if-modified-since。我注意到(我运行的旧版本)IE和Netscape似乎从未发送过如果修改过的。但奇怪的是,Opera发送了
if-modified-since但是当我回复HTTP / 1.0 304 Not Modified时它没有从屏幕上刷新屏幕,它离开了屏幕空白。

我只能断定我要么没有返回正确的协议
包括HTTP / 1.0 304 Not Modified的序列,或者我正在运行的旧Opera包含一个bug。我打赌我的代码中的错误回答。

任何人都有处理if-modified的经验,因为他们自己和
正确地做了吗?
[originally posted in alt.www.webmaster, was suggested that this ng
could be a better place.]

I''ve updated my test server to handle if-modified-since. I''ve noticed
that the (old copies I run of) IE and Netscape seem never to send
if-modified-since. But the strange thing is that Opera sends
if-modified-since but when I reply with "HTTP/1.0 304 Not Modified" it
is not refreshing the screen from its cache, it is leaving the screen
blank.

I can only conclude that either I am not returning a correct protocol
sequence including "HTTP/1.0 304 Not Modified", or that the old Opera
I''m running contains a bug. I''m betting on the incorrect response in
my code.

Anybody have experience with handling if-modified-since themselves and
doing it properly?




恕我直言,你在这里混合两个阶段:HTTP请求和HTTP响应


一方提出请求并避免不必要的带宽使用可能

设置If-Modified-Since:< Date> *请求*标题。


正确配置的服务器必须检查< Date>并使用内容或304 Not Modified *响应*标题回复




这不是Web服务器的附加功能,这是一个核心功能

正常的HTTP / 1.1兼容网络服务器。


If-Modified-Since(以及If-None-Match,If-Range并且

If-Unmodified-Since)与UA< - >无关。服务器通信

架构,它是为服务器< - >而制作的。服务器通信。


仍然在XMLHttpRequest(Gecko)中你可以设置setRequestHeader,如果web

服务器没有被破坏,它将发送数据或304。 br />

我不确定最初的IXMLHTTPRequest(微软)。 MSDN

看起来很安静,但它仍然可以实现。你可以尝试。


在任何情况下都不允许UA通过

本身设置额外的请求标头,而无需用户交互。如果Opera确实这样做了(?),那么

有一个破坏的HTTP / 1.1部分。


如果请求对象对If-Modified不感兴趣 - 自检查,

然后它也对检查结果不感兴趣(304或其他东西

其他)。



IMHO you are mixing two stages here: HTTP Request and HTTP Response

One side is making a request and to avoid unnecessary bandwight use may
set If-Modified-Since: <Date> *request* header.

Properly configured server has to check the <Date> and either respond
with content, or with 304 Not Modified *response* header.

It is not an additional feature of a web server, this is a core feature
of a normal HTTP/1.1 compliant web server.

If-Modified-Since (as well as If-None-Match, If-Range and
If-Unmodified-Since) has no relation to a UA <-> server communication
schema, it was made for server <-> server communications.

Still in XMLHttpRequest (Gecko) you can setRequestHeader and if the web
server is not broken, it will either send data or 304.

I am not sure about the original IXMLHTTPRequest (Microsoft). The MSDN
seems silent, but it may be still implemented. Yours to try.

In any case no UA is allowed to set additional request headers by
itself, without user interaction. If Opera indeed does that(?), then it
has a broken HTTP/1.1 part.

If the request object was not interested in If-Modified-Since check,
then it also not interested in the check results (304 or something
else).


VK写道:
VK wrote:

hug写道:

hug wrote:
[最初发布于alt。 www.webmaster ,有人建议这个更好的地方。]

$ b $嗯,我建议你寄回去;)

我已经更新了我的测试服务器来处理if-modified-since。我注意到(我运行的旧版本)IE和Netscape似乎从未发送过如果修改过的。但奇怪的是,Opera发送了
if-modified-since但是当我回复HTTP / 1.0 304 Not Modified时它没有从屏幕上刷新屏幕,它离开了屏幕空白。

我只能断定我要么没有返回正确的协议
包括HTTP / 1.0 304 Not Modified的序列,或者我正在运行的旧Opera包含一个bug。我打赌我的代码中的错误回答。
[originally posted in alt.www.webmaster, was suggested that this ng
could be a better place.]
Well, I''d suggest to send you back ;)
I''ve updated my test server to handle if-modified-since. I''ve noticed
that the (old copies I run of) IE and Netscape seem never to send
if-modified-since. But the strange thing is that Opera sends
if-modified-since but when I reply with "HTTP/1.0 304 Not Modified" it
is not refreshing the screen from its cache, it is leaving the screen
blank.

I can only conclude that either I am not returning a correct protocol
sequence including "HTTP/1.0 304 Not Modified", or that the old Opera
I''m running contains a bug. I''m betting on the incorrect response in
my code.



URL(如果可公开访问)?或者获取HTTP标头(例如,实时HTTP

FF的标头扩展名)并发布''em。

这不是Web服务器的附加功能,这是一个正常的HTTP / 1.1兼容Web服务器的核心功能。


当然可以,但是如果涉及服务器端代码,那么这个功能可能会(重新)实施

。 OP没有明确提到这一点,但

这就是我猜的。

If-Modified-Since(以及If-None-Match,If -Range和
If-Unmodified-Since)与UA< - >无关。服务器通信
架构,它是为服务器< - >而制作的。服务器通信。


这些标头将由任何支持缓存的客户端使用。为什么要排除美元?如果在现代浏览器中没有广泛实现,那么Firefox会发送If- *标题(对于可缓存文档)而且我会感到惊讶。

在任何情况下都不允许使用UA无需用户交互即可通过
设置其他请求标头。如果Opera确实这样做(?),那么
有一个破坏的HTTP / 1.1部分。


URL (if publicly accessible)? Or fetch the HTTP headers (e.g. Live HTTP
Headers extension for FF) and post ''em.
It is not an additional feature of a web server, this is a core feature
of a normal HTTP/1.1 compliant web server.
Sure, but if there''s server-side code involved, than this ''feature'' may has
to be (re-)implemented. The OP has not mentioned this explicitly, but
that''s what I would guess.
If-Modified-Since (as well as If-None-Match, If-Range and
If-Unmodified-Since) has no relation to a UA <-> server communication
schema, it was made for server <-> server communications.
These header are to be used by any client that supports caching. Why should
UAs be excluded? Firefox sends If-* headers (for cacheable documents) and I
would be suprised, if this is not widely implemented in modern browsers.
In any case no UA is allowed to set additional request headers by
itself, without user interaction. If Opera indeed does that(?), then it
has a broken HTTP/1.1 part.




我从未手动设置HTTP请求标头一个浏览器。我为我的首选语言设置了选项

(由

浏览器转换为Accept-Language标头)或缓存处理(可能导致发送If- *标头)。


-

Benjamin Niemann

电子邮件:pink at odahoda dot de

WWW:< a rel =nofollowhref =http://pink.odahoda.de/target =_ blank> http://pink.odahoda.de/


On Sun,2006年5月7日,hug写道:
On Sun, 7 May 2006, hug wrote:
[最初发布于alt。 www.webmaster ,有人认为这可能是一个更好的地方。]


说实话,我认为他们给了你很好的建议。这似乎是浏览器/服务器交互的一个

功能,它与创作HTML没有直接关系。

。我期待在网络上找到专家

服务器组,或者可能在CGI创作组(在后者

的情况下,提防automoderation bot!) 。


但是好吧,让我们尝试开始,尽管如此。

我已经更新了我的测试服务器来处理if-modified -以来。


体面的服务器是开箱即用的,不是吗?


这是什么样的服务器?你在使用服务器自己的

代码吗?添加模块?编写CGI脚本?

我注意到(我运行的旧版本)IE和Netscape似乎永远不会发送if-modified-since。


具体! "网景" ;? 4或更少? 6个或更多?它们完全是

不相关的代码库。


我使用的浏览器,肯定会发送if-modifed-因为

请求。但是,他们有偏好/选项可以调整他们在这方面的行为,并且可以配置为永远不会检查

的更新。

但奇怪的是,Opera发送if-modified-since但是当我回复HTTP / 1.0 304 Not Modified时它不会从缓存中刷新
屏幕,而是将屏幕留空。


你知道,如果没有你的实际服务器在

互联网上玩,我们会尽力帮助你至少一只手绑

支持我们。

我只能得出结论,我要么没有返回正确的协议序列,包括HTTP / 1.0 304 Not Modified,或者我正在运行的老歌剧包含一个bug。


下载当前版本进行比较有什么问题?

我有Opera 7,Opera 8和Opera 9 -preview安装

分别进行测试。例如。

我打赌我的代码中的错误响应。


我们还没有看到任何代码。


虽然可以通过代理来检测这种事情,并且

得到代理来报告每个方向传递的标题(你可以找到这样的事情记录在CGI和/或Perl的常见问题解答中,用于

示例),有时在测试平台上运行Ethereal更容易

并且只监控网络流量。


现在Ethereal在解码数据包有效负载时做了一个非常好的路线

- 它通常不需要专家来取消结果。事实上我只是在几天前使用它来研究一个HTTP事务(并且在其日志中的其他地方发现了
我发现了304响应,但它不是我当时正在寻找的是什么,所以我不能多说了。

任何人都有处理if-modified的经验 - 因为他们自己
并且正确地做到了吗?
[originally posted in alt.www.webmaster, was suggested that this ng
could be a better place.]
To be honest, I think they gave you poor advice. This appears to be a
feature of browser/server interaction which has nothing directly to do
with authoring HTML. I''d anticipate finding the experts on a web
servers group, or maybe on the CGI authoring group (in the latter
case, beware of the automoderation bot!).

But OK, let''s try and make a start, despite that.
I''ve updated my test server to handle if-modified-since.
Decent servers do this out of the box, don''t they?

What manner of server is this? Are you working on the server''s own
code? Adding a module? Writing a CGI script?
I''ve noticed that the (old copies I run of) IE and Netscape seem
never to send if-modified-since.
Be specific! "Netscape"? 4 or less? 6 or more? They are totally
unrelated codebases.

The browsers that I use, most certainly do send if-modifed-since
requests. However, they have preferences/options which can adjust
their behaviour in this regard, and could be configured to never check
for updates.
But the strange thing is that Opera sends if-modified-since but when
I reply with "HTTP/1.0 304 Not Modified" it is not refreshing the
screen from its cache, it is leaving the screen blank.
You know, without having your actual server to play with over the
Internet, we''d be trying to help you with at least one hand tied
behind our backs.
I can only conclude that either I am not returning a correct protocol
sequence including "HTTP/1.0 304 Not Modified", or that the old Opera
I''m running contains a bug.
What''s the problem with downloading a current one for comparison?
I''ve got an Opera 7, an Opera 8 and an Opera 9-preview installed
separately for testing. For example.
I''m betting on the incorrect response in my code.
We haven''t seen any code yet.

While it''s possible to instrument this kind of thing via a proxy, and
get the proxy to report the headers passing in each direction (you can
find this sort of thing documented in FAQs for CGI and/or Perl, for
example), it''s sometimes easier to run Ethereal on the test platform
and just monitor the network traffic.

Ethereal nowadays does a very nice line in decoding the packet payload
- it usually doesn''t need an expert to unpick the results. In fact I
was using it only a few days ago to study an HTTP transaction (and
elsewhere in its log I spotted a 304 response, but it wasn''t what I
was looking for at the time, so I can''t say much more).
Anybody have experience with handling if-modified-since themselves
and doing it properly?




排序,但是我的测试区域中没有任何内容可以用来支付
作为Opera的即时测试。我建议你需要先显示一下

你的工作,然后才能从

组中得到任何有用的东西 - BICBW。


祝你好运



Sort-of, but there''s nothing in my test area at the moment that would
serve as an instant test of Opera. I''d suggest you need to show a bit
more of your working before you''d rate to get anything useful from the
group - BICBW.

good luck


这篇关于if-modified-since问题(协议问题?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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