-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(dag-protobuf): cache dag pb directory structure and block indexes #147
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc9ad59
basic impl of dab_pb content cache
fforbeck 98906fd
fixes and enhancements
fforbeck 272a02c
code clean up and fixes
fforbeck 295e3a2
added kv cache for staging and prod
fforbeck 689d364
added env vars for staging and prod
fforbeck 9f37cb0
disable cache in prod
fforbeck 09f749d
address reviewers feedback
fforbeck 03a7f78
testing dagpb content cache
fforbeck b58f0f2
update prod cache ttl for 30 days
fforbeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
import { KVNamespace } from '@cloudflare/workers-types' | ||
import { Environment as MiddlewareEnvironment } from '@web3-storage/gateway-lib' | ||
|
||
export interface Environment extends MiddlewareEnvironment { | ||
CONTENT_CLAIMS_SERVICE_URL?: string | ||
/** | ||
* The KV namespace that stores the DAGPB content cache. | ||
*/ | ||
DAGPB_CONTENT_CACHE: KVNamespace | ||
/** | ||
* The number that represents when to expire the key-value pair in seconds from now. | ||
* The minimum value is 60 seconds. Any value less than 60MB will not be used. | ||
*/ | ||
FF_DAGPB_CONTENT_CACHE_TTL_SECONDS?: string | ||
/** | ||
* The maximum size of the key-value pair in MB. | ||
* The minimum value is 1 MB. Any value less than 1MB will not be used. | ||
*/ | ||
FF_DAGPB_CONTENT_CACHE_MAX_SIZE_MB?: string | ||
/** | ||
* The flag that enables the DAGPB content cache. | ||
*/ | ||
FF_DAGPB_CONTENT_CACHE_ENABLED: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If we don't disable this global cache in test the requests won't reach the Content Claim Dagula middleware where we have the KV cache.