Skip to content

Provide a way to turn off cache busting #327

@nickodell

Description

@nickodell

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.

Additional context

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions