Re: [dev] regarding surf and cookie handling

From: Troels Henriksen <athas_AT_sigkill.dk>
Date: Wed, 22 Feb 2012 15:17:40 +0100

Calvin Morrison <mutantturkey_AT_gmail.com> writes:

> On 22 February 2012 08:36, Troels Henriksen <athas_AT_sigkill.dk> wrote:
>> Calvin Morrison <mutantturkey_AT_gmail.com> writes:
>>
>>> But, since we write out to the cookie jar frequently, wouldn't it be
>>> inefficient to be constantly re reading (and reparsing) the entire
>>> cookie file?
>>
>> Yes, but we're already doing that, so apparently it's not a big problem
>> in practice.
>
> I was clear that we were constantly writing to the cookie jar. I was
> not clear that we were manually rereading it each time, now i see that
> the getcookies function is doing it. That seems rather inefficient
> also because on every request signal emitted we are reloading the
> cookie jar. That means it's not only every time we reload a page, but
> whenever the page requests new info (eg facebook while scrolling
> through the feed)
>
> What is a better solution, or is that the best solution?

A better solution would be to cache the cookie file contents and only
re-read if something has changed. The "best" solution, with respect to
efficiency, would be to have some central cookie daemon that can send
the changed cookies to the running Surf instances. Uzbl uses this last
approach, but I think it's far too complicated.

-- 
\  Troels
/\ Henriksen
Received on Wed Feb 22 2012 - 15:17:40 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 22 2012 - 15:24:04 CET