Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docket: add glob contents into eyre cache #260

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

Fang-
Copy link
Member

@Fang- Fang- commented Feb 15, 2024

Globs contain big, static blobs of data, that only get updated periodically. Eyre has an affordance for caching responses at specified urls.

Here we update docket to, whenever a glob gets added, updated or removed, manage the eyre response cache to match. We call +new-cache in every place where either +new-docket or +new-chad gets called, making sure to pass in the old $charge so that we can clear potentially-stale entries from the cache.

Note that docket's dynamic request serving behavior would respond to both /path.ext and /path/ext with the glob entry for the (clay-style) path /path/ext. However, we only add a response for the '/path.ext' url into the cache. This is the common case, and doing so avoids adding twice the amount of cache pressure.

For the %groups desk, whose initial pageload requests 32 files, this takes initial load time down from ~0.5s to ~0.1s (on localhost, so no "real networking" overhead).

About half of that remaining time is spent on the initial page request, which usually dynamically falls back to serving ./index.html. About a fifth is spent on loading ./desk.js and /session.js, which are served by docket independent of glob contents. Adding those into the cache could bring additional performance gains.

This should be considered soft-blocked on urbit/urbit#6909 and urbit/vere#603. Without those changes, docket may make /apps/* urls permanently unusable for dynamic binding.

(Targets #259 because the changes there are a prerequisite for getting docket to compile in the first place...)

Closes LAND-1539.

Globs contain big, static blobs of data, that only get updated
periodically. Eyre has an affordance for caching responses at specified
urls.

Here we update docket to, whenever a glob gets added, updated or
removed, manage the eyre response cache to match. We call +new-cache in
every place where either +new-docket or +new-chad gets called, making
sure to pass in the old charge so that we can clear potentially-stale
entries from the cache.

Note that docket's dynamic request serving behavior would respond to
both /path.ext and /path/ext with the glob entry for the (clay-style)
path /path/ext. However, we only add a response for the '/path.ext' url
into the cache. This is the common case, and doing so avoids adding
twice the amount of cache pressure.

For the %groups desk, whose initial pageload requests 32 files, this
takes initial load time down from ~0.5s to ~0.1s (on localhost, so no
"real networking" overhead).

About half of that remaining time is spent on the initial page request,
which usually dynamically falls back to serving /index.html. About a
fifth is spent on loading desk.js and session.js, which are served by
docket independent of glob contents. Adding those into the cache could
bring additional performance gains.

This should be considered soft-blocked on urbit/urbit#6909 and
urbit/vere#603. Without those changes, docket may make /apps/* urls
permanently unusable for dynamic binding.
@Fang- Fang- requested a review from arthyn February 15, 2024 13:48
Copy link

linear bot commented Feb 15, 2024

@Fang- Fang- added the enhancement New feature or request label Feb 15, 2024
Copy link
Member

@arthyn arthyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, let's wait to merge until those PRs go through

Base automatically changed from m/fip-unparse to develop February 15, 2024 17:30
Instead of always wiping and optionally replacing for edits, don't wipe
in the first place, for paths whose contents were changed but not
deleted.
@Fang- Fang- requested a review from arthyn September 30, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants