TSUCHIYA Masatoshi | 6 Feb 2010 11:10
Favicon

[emacs-w3m:11129] Re: cache control broken?

>> On Wed, 20 Jan 2010 22:41:05 +0900
>> tsuchiya <at> namazu.org (TSUCHIYA Masatoshi) said as follows:

>>>> 半年くらい前から困っているのですが,emacs-w3m と各種の WiKi との通信
>>>> がうまくいかない場合が増えました.

>>> ちょっと試してみたんですが、こちらでは問題無いですねえ。

>>ぼくの環境も大丈夫ですね。

>むう.私の環境固有の問題なのか….

すみません,なんか記憶があやふやで分からなくなってきました.

(defun w3m-w3m-retrieve-1 (url post-data referer no-cache counter handler)
  (let ((w3m-command-arguments
	 (append w3m-command-arguments
		 (when (member "cookie" w3m-compile-options)
		   (list "-no-cookie"))
		 (list "-o" "follow_redirection=0")
		 (w3m-additional-command-arguments url)))
	(cachep (w3m-cache-available-p url))
  <中略>
      (w3m-process-do
	  (attr (or (unless no-cache
		      (and cachep
			   (w3m-cache-request-contents url)
			   (w3m-w3m-parse-header
			    url (w3m-cache-request-header url))))
		    (w3m-w3m-dump-extra url handler)))

ということなので,w3m-cache-available-p() が non-nil を返した場合に
は,cache を使うようですね.

それで,w3m-cache-available-p() のロジックを観察して見ると,現状の
emacs-w3m って cache に格納されている場合,cache-control: や expire: が存
在しなければ,無条件に cache を使ってしまってます?

last-modified: が存在しない場合には,動的なコンテンツだと見なして
w3m-cache-available-p() が nil を返すようにした方が良いかなあと思ったりす
るのですが‥‥‥何か間違えてそうな気がします.

--

-- 
土屋 雅稔 ( TSUCHIYA Masatoshi )
Attachment: text/x-diff, 410 bytes

Gmane