-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: read cache settings from env var (#31)
Description --- Read cache related settings on the start from env var (with some default values). Motivation and Context --- How Has This Been Tested? --- See the cache settings, try to change the env var and rerun to see the effect. What process can a PR reviewer use to test or verify this change? --- <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
- Loading branch information
Showing
7 changed files
with
33 additions
and
13 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var cacheSettings = { | ||
index: | ||
process.env.TARI_EXPLORER_INDEX_CACHE_SETTINGS || | ||
"public, max-age=120, s-maxage=60, stale-while-revalidate=30", | ||
mempool: | ||
process.env.TARI_EXPLORER_MEMPOOL_CACHE_SETTINGS || | ||
"public, max-age=15, s-maxage=15, stale-while-revalidate=15", | ||
oldBlocks: | ||
process.env.TARI_EXPLORER_OLD_BLOCKS_CACHE_SETTINGS || | ||
"public, max-age=604800, s-maxage=604800, stale-while-revalidate=604800", | ||
newBlocks: | ||
process.env.TARI_EXPLORER_NEW_BLOCKS_CACHE_SETTINGS || | ||
"public, max-age=120, s-maxage=60, stale-while-revalidate=30", | ||
oldBlockDeltaTip: | ||
process.env.TARI_EXPLORER_OLD_BLOCK_DELTA_TIP || 30 * 24 * 7, | ||
}; | ||
|
||
module.exports = cacheSettings; |
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
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