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

What unit is immutableMinTimeToLive in? #25

Open
jameysharp opened this issue Nov 11, 2019 · 1 comment
Open

What unit is immutableMinTimeToLive in? #25

jameysharp opened this issue Nov 11, 2019 · 1 comment

Comments

@jameysharp
Copy link

The readme says that "immutableMinTimeToLive is a number of milliseconds", but it's compared against values which are in seconds (e.g. Math.max(defaultMinTtl, (expires - dateValue) / 1000)) and returned from maxAge which on other paths returns values in seconds.

In my opinion, the implementation is reasonable so it's the documentation which is wrong; what do you think?

The default value is 24 * 3600 * 1000, which is either one day or 1,000 days depending on the answer to this question. I don't see anything in the RFC guiding how clients should behave if max-age is not set but immutable is. Since "hours * seconds * milliseconds" order makes a little more sense than "hours * seconds * days", I'm guessing it was supposed to be one day, in which case the default value is wrong too.

While you're looking at the documentation for this option:

  • The link to "per RFC" is dead. I believe at this point you want to link to https://tools.ietf.org/html/rfc8246.
  • Please document the default value for this option, whatever you decide it should have been.
@kornelski
Copy link
Owner

This whole thing for immutable is a heuristic. If there's no explicit max-age set, then clients can guess. I guess that immutable responses are fresh for longer than other responses.

It's very likely that I mixed up seconds and milliseconds, since I've changed the units at some point. The intention was one day.

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