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

feat(denylist): edge cached responses #162

Merged
merged 13 commits into from
Jun 12, 2023
Merged

Conversation

alanshaw
Copy link
Member

  • Cache responses for listed CIDs for 1 day
  • Cache responses for unlisted CIDs for 1 hour

@@ -8,19 +8,9 @@ import { toDenyListAnchor } from '../src/utils/denylist.js'
*/
const createTestCid = async (s) => await Hash.of(s, { cidVersion: 1 })

const cidNotInDenyList = await createTestCid('not in denylist')
const cidInDenyList = await createTestCid('asdfasdf')
const cidInDenyListBlockedForLeganReasons = await createTestCid('blocked for legal reasons')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standard was complaining of the top level await...

@@ -33,7 +33,7 @@
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*.*": "standard"
"*.js": "standard"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just lint the javascripts, not the yaml and json

const headers = options.headers || new Headers()
const noAbortRequestsOnWinner = Boolean(options.noAbortRequestsOnWinner)
const onRaceEnd = options.onRaceEnd || nop
const gatewaySignals = options.gatewaySignals || {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typescript lint made me do this...

Copy link
Contributor

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✨

packages/denylist/src/cache.js Outdated Show resolved Hide resolved
@alanshaw alanshaw merged commit fc8b9f2 into main Jun 12, 2023
@alanshaw alanshaw deleted the feat/edge-cached-responses branch June 12, 2023 15:28
alanshaw pushed a commit that referenced this pull request Jun 12, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.1.0](denylist-v1.0.1...denylist-v1.1.0)
(2023-06-12)


### Features

* **denylist:** edge cached responses
([#162](#162))
([fc8b9f2](fc8b9f2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
vasco-santos pushed a commit that referenced this pull request Jun 13, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.5.0](ipfs-gateway-race-v1.4.1...ipfs-gateway-race-v1.5.0)
(2023-06-12)


### Features

* **denylist:** edge cached responses
([#162](#162))
([fc8b9f2](fc8b9f2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants