lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev PATCH [dev21]: source caching


From: Scott Bigham
Subject: lynx-dev PATCH [dev21]: source caching
Date: Sat, 10 Apr 1999 23:59:55 -0400 (EDT)

On the If You Want This New Feature, Why Don't You Code It Yourself
principle, and because I finally got fed up with reloading an entire
document just to look at the source or turn on image links (and because so
many other people have asked for it... and just to prove it could be
done...), I submit the enclosed patch against dev21 implementing HTML
source caching.

In this implementation, each document kept in cache has associated with it
a temporary file containing the HTML source for the document (well, not all
of them -- only those using the HTTP protocol, on the premise that file://
documents are probably local and ftp:// documents are probably not HTML).
The temporary file is deleted when the document is uncached.  For certain
operations, instead of reloading the document via HTLoad<mumble>(), the
source file is reparsed with HTParseFile().  The cached document also
remembers certain parser settings (screen size, historical vs. minimal vs.
valid comment parsing, and the like), and is regenerated from source if it
is fetched out of cache under different settings.

This behavior is selectable by a configure option --enable-source-cache and
by a lynx.cfg option SOURCE_CACHE; I didn't add a command-line argument or
an options menu entry, as this didn't seem to be the sort of thing one
would want to change at runtime.

Assorted notes:
  - Oddly, some of the commands I modified reload the document by faking an
    LYK_RELOAD, and some by calling HTuncache_current_document().  Any
    particular reason for the difference?  I ask because the latter did the
    HTuncache_...() before printing the associated message and I had to
    move it after to get the reparse to work, and I probably did it wrong.
  - I try to be intelligent about passing the source cache file along to
    the newly generated HText, but I'm a bit nervous about passing it
    around in a global variable...

As always, apply with caution; I've almost certainly gotten something
wrong.

(I wonder if this is gonna start up that whole argument again....)

                                                -sbigham

Attachment: source_cache.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]