Reference
Cached views
A view's HTML depends on its arguments and on the global variables it reads. When a view is called again with the same arguments, and none of those globals has been assigned since, Quillo reuses the HTML it rendered last time instead of running the view again. A page made of views is then served about as fast as a static file (the 50-row benchmark page goes from about 26,000 to 84,000 pages a second), and is still up to date the moment something it shows changes.
- Arguments are compared by value for numbers and text, and by identity for lists and
maps: values never change, so the same list is the same data.
<List items={products}/>is reused untilproductsis assigned;<List items={[1, 2]}/>builds a new list each time and is rendered each time. - A view that reads the clock, randomness, the database, files, the environment, the
network or the request (
url()), prints, writes, or renders a component, runs every time. Database reads are not cached because a row changed outside Quillo would go unnoticed. - Views inside views pass on what they read, so a cached page follows the global its innermost view uses. Only views declared at the top level are cached, and at most 32 renders of each are kept (the 32 most recent sets of arguments).
- Starting the program with
--no-view-cache,quillo run main.qwe --no-view-cache, turns it off (to measure, or to rule it out).
Thread
Thread 0 posts
On Cached views: questions, tips, corrections, and code that uses it.
No posts yet. The first one opens the thread.
Edit this page on GitHub · made from the user guide · questions on Discord or r/quillo