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(response-cache): add response-cache-upstash #1404

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

chronark
Copy link

@chronark chronark commented May 30, 2022

Add redis cache using stateless HTTP connections instead of TCP with Upstash Redis.

Description

This is basically a copy of response-cache-redis where I changed a few details to make it work with @upstash/redis http client.

Implements #1218

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  1. Create a free database on Upstash
  2. UPSTASH_REDIS_REST_URL=".." UPSTASH_REDIS_REST_TOKEN=".." yarn test

Test Environment:

  • OS: macOS 12.4
  • NodeJS: 16.15.0

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

I haven't figured out why the tests are not passing yet, to me it seems unrelated to the implementation but I will take another look this week. It writes and reads from the cache but for some reason doesn't use the cache sometimes.

@n1ru4l
Copy link
Owner

n1ru4l commented Jun 9, 2022

Hey @chronark, tests here are currently failing because we are still running tests against Node.js version 12. After #1417 is merged, you can rebase this branch. 😇

@n1ru4l
Copy link
Owner

n1ru4l commented Jul 11, 2022

@chronark We will delay dropping Node.js 12 support until The Yoga v3 launch (dotansimha/graphql-yoga#1358). Is there an alternative (older) version of @upstash/redis, that still supports Node.js 12?

@chronark
Copy link
Author

chronark commented Jul 11, 2022

Hmm, v1.3.0 or older might still work. But I'm not 100% sure.
I won't have time this week but I'll add it to my todo list.

@changeset-bot
Copy link

changeset-bot bot commented Jul 20, 2022

⚠️ No Changeset found

Latest commit: fb47e92

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jul 20, 2022

@chronark is attempting to deploy a commit to the The Guild Team on Vercel.

A member of the Team first needs to authorize it.

@n1ru4l
Copy link
Owner

n1ru4l commented Nov 22, 2022

@chronark hey, we dropped Node 12 support by now - do you mind rebasing this PR?

@chronark
Copy link
Author

@n1ru4l I'll put it on my todo list for this or next week
thanks for letting me know

@YassinEldeeb
Copy link
Collaborator

Hey @chronark, that's a neat plugin. Could you please rebase this PR?

@chronark
Copy link
Author

Can't really get the tests to pass right now and I'm not sure why
It definitely caches data to redis.
I'll give this another shot tomorrow

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.

None yet

3 participants