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

REST server should cache open documents #70

Open
ccxvii opened this issue Apr 23, 2024 · 0 comments
Open

REST server should cache open documents #70

ccxvii opened this issue Apr 23, 2024 · 0 comments
Assignees

Comments

@ccxvii
Copy link
Collaborator

ccxvii commented Apr 23, 2024

Repeatedly doing fetch() on the same document from a third party server without caching is going to be slower than it needs to be. We should cache the most recently used documents and reuse the same array buffer that has already been fetched.

This caching can be handled in loadDocumentFromUrl, which can resolve to the cached document if it is in the cache.

Ideally we should use the fetch HTTP response headers to check for freshness as well, but that may be overkill for an example server.

ccxvii added a commit that referenced this issue Apr 23, 2024
Required us to remove the abbreviated express type imports, because
we have to distinguish between the built-in fetch Response type and
the express framework Response type.
ccxvii added a commit that referenced this issue Apr 25, 2024
Required us to remove the abbreviated express type imports, because
we have to distinguish between the built-in fetch Response type and
the express framework Response type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants