Cache Object
Prev | Chapter 15. Scripting ELinks with ECMAScript | Next

## Cache Object

The cache object mentioned in the descriptions of elinks.load_uri and elinks.preformat_html is a wrapper for the internal ELinks cache object. ELinks passes the ECMAScript cache object as an argument to your ECMAScript function, and keeps the corresponding document in the cache until the function returns. After that, ELinks may remove the document from the cache, even if the function has saved the cache object to some global variable. Such an expired cache object does not work but it does not crash ELinks either.

### Cache Object Properties

cached.content (string):: This is the content received from the server. It can be read and set.

cached.type (string):: This is the MIME type of the cache entry. It can be read and set.

cached.length (number):: This is the length of cached.content. It is read-only.

cached.head (string):: This is the header received from the server. It can be read and set.

cached.uri (string):: This is the URI of the cache entry. It is read-only.

Prev | Up | Next
ELinks Object Hooks | Home | View-state Object