-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Problem
Hello, I'm a maintainer for SciPy, and I'm looking for ways to improve the caching behavior of our documentation site.
Looking through our top URLs, the 4th most commonly requested URL is https://docs.scipy.org/doc/scipy/try_examples.json.
One reason that might be happening is that in jupyterlite_sphinx.js, this file is being requested with a ?cb= parameter. This defeats any Cache-Control headers the server might be sending.
| const configFileUrl = `${configFilePath}?cb=${timestamp}`; |
I would like a way to control how long the client caches the content for, using a standard HTTP header such as Cache-Control.
Proposed Solution
Provide a config option that when set, causes the client to no longer use cache busting.
Alternatively, cache busting could be disabled entirely. In our configuration, this file changes maybe on the time scale of months, and it doesn't seem like constantly reloading it provides much value to the user. You could recommend to users who want the client to not cache try_examples.json to use a standard HTTP header to control the cache behavior of that client, such as Cache-Control: no-cache.