-
Notifications
You must be signed in to change notification settings - Fork 89
add cache behavior modifiers to RequestInit interface #17
Conversation
documentation for these features can be found at https://developers.cloudflare.com/workers/about/using-cache/
index.d.ts
Outdated
@@ -5,6 +5,8 @@ interface FetchEvent { | |||
interface RequestInit { | |||
cf?: { | |||
cacheEverything?: boolean | |||
cacheTtl?: number | |||
cacheTtlByStatus?: { [key: string]: number } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be a good idea and add some comments on how to use this DSL. Show an @example
of the range syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are examples in the provided Cloudflare documentation. Or do you mean add examples to the readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrf0110 just bumping for some clarification please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think he meant examples inline in the comments, like some of the other fields have. While it’s duplicative of the docs, this will ensure IDEs provide helpful documentation directly in your editor. We’d also like to auto-generate docs from these comments eventually.
Also, I recently merged a refactor that creates a conflict. You’ll want to put these on the new CfRequestInit
interface, now, if you can rebase on master.
If you think you can update that sometime today or tomorrow, let us know — I’d love to include this in a 1.0.10 release on Friday.
Also happy to do that ourselves if you don’t have time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ispivey I should have time to do it today, if it's not done in the next 12 hours feel free to do so yourself if you have the time. Thanks heaps for the comment!
@ispivey I've added those examples if you're happy with that. |
Thanks, and thanks so much for contributing! |
Documentation for these features can be found here , under the
Overriding TTL
andOverride based on origin response code
headings.