Conversation
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.
arthyn
approved these changes
Feb 15, 2024
Member
arthyn
left a comment
There was a problem hiding this comment.
lgtm, let's wait to merge until those PRs go through
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.
Member
Author
|
Tested this again on top of #311, seems to still work fine. Let's get this in, finally! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-cachein every place where either+new-docketor+new-chadgets called, making sure to pass in the old$chargeso that we can clear potentially-stale entries from the cache.Note that docket's dynamic request serving behavior would respond to both
/path.extand/path/extwith 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
%groupsdesk, 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.jsand/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.