Skip to content

Feature: ioredis#179

Merged
AyronK merged 8 commits intofortedigital:masterfrom
themitvp:feature/ioredis
Jan 19, 2026
Merged

Feature: ioredis#179
AyronK merged 8 commits intofortedigital:masterfrom
themitvp:feature/ioredis

Conversation

@themitvp
Copy link
Copy Markdown
Contributor

A draft PR to start collaborating on adding support for ioredis.

Solves #154

@themitvp themitvp mentioned this pull request Dec 15, 2025
Copy link
Copy Markdown
Collaborator

@AyronK AyronK left a comment

Choose a reason for hiding this comment

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

Hey, great work! I added a couple of comments, cosmetic. One more things, if you had time, would you add this integration to the example project? For instance behind an env variable such as REDIS_TYPE=<"ioredis":"node:redis">. Then we could resolve a different client in the cache handler. Just to make it easy to verify.

Comment thread packages/nextjs-cache-handler/src/helpers/ioredisAdapter.ts Outdated
Comment thread packages/nextjs-cache-handler/src/helpers/ioredisAdapter.ts Outdated
Comment thread packages/nextjs-cache-handler/src/helpers/ioredisAdapter.ts Outdated
@themitvp
Copy link
Copy Markdown
Contributor Author

themitvp commented Jan 5, 2026

Hey, great work! I added a couple of comments, cosmetic. One more things, if you had time, would you add this integration to the example project? For instance behind an env variable such as REDIS_TYPE=<"ioredis":"node:redis">. Then we could resolve a different client in the cache handler. Just to make it easy to verify.

Thanks for your review! 🙌
I added it to the example project, please let me know if it works for you.

@AyronK
Copy link
Copy Markdown
Collaborator

AyronK commented Jan 7, 2026

Hey, great work! I added a couple of comments, cosmetic. One more things, if you had time, would you add this integration to the example project? For instance behind an env variable such as REDIS_TYPE=<"ioredis":"node:redis">. Then we could resolve a different client in the cache handler. Just to make it easy to verify.

Thanks for your review! 🙌 I added it to the example project, please let me know if it works for you.

Cool, I've just returned from a long xmas break. I'll try to test it this week.

Copy link
Copy Markdown
Collaborator

@AyronK AyronK left a comment

Choose a reason for hiding this comment

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

I have fixed the import locally and tried to run the example project. It does not seem to work.

  1. Instrumentation does not add anything, while with the default redis every example is properly initialized on startup
  2. Visiting example pages that should trigger cache save, does not save anything
  3. In logs I see a lot of undefined errors:
[CacheHandler] Instance created with provided context.
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: get] [key: /favicon.ico] Started retrieving value in order.
[CacheHandler] [handler: composite] [method: get] [key: /favicon.ico] Started retrieving value.
[CacheHandler] [method: get] [key: /manifest.webmanifest] Retrieving value not found.
pending revalidates promise finished for: { pathname: '/manifest.webmanifest', search: '' }
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: set] [key: /manifest.webmanifest] Started setting value in parallel.
[CacheHandler] [method: get] [key: /favicon.ico] Retrieving value not found.
pending revalidates promise finished for: { pathname: '/favicon.ico', search: '' }
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: set] [key: /favicon.ico] Started setting value in parallel.
[CacheHandler] [handler: composite] [method: set] [key: /manifest.webmanifest] Error: TypeError: Cannot read properties of undefined (reading 'options')
[CacheHandler] [handler: composite] [method: set] [key: /favicon.ico] Error: TypeError: Cannot read properties of undefined (reading 'options')

@themitvp please address those issues and test the code before asking me to do so 🙏🏻 It seems you have not even tried it with the example project.

I'll take a look again once you're ready.

Comment thread examples/redis-minimal/cache-handler.mjs Outdated
Comment thread packages/nextjs-cache-handler/package.json
@themitvp
Copy link
Copy Markdown
Contributor Author

I have fixed the import locally and tried to run the example project. It does not seem to work.

  1. Instrumentation does not add anything, while with the default redis every example is properly initialized on startup
  2. Visiting example pages that should trigger cache save, does not save anything
  3. In logs I see a lot of undefined errors:
[CacheHandler] Instance created with provided context.
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: get] [key: /favicon.ico] Started retrieving value in order.
[CacheHandler] [handler: composite] [method: get] [key: /favicon.ico] Started retrieving value.
[CacheHandler] [method: get] [key: /manifest.webmanifest] Retrieving value not found.
pending revalidates promise finished for: { pathname: '/manifest.webmanifest', search: '' }
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: set] [key: /manifest.webmanifest] Started setting value in parallel.
[CacheHandler] [method: get] [key: /favicon.ico] Retrieving value not found.
pending revalidates promise finished for: { pathname: '/favicon.ico', search: '' }
[CacheHandler] Using existing CacheHandler configuration.
[CacheHandler] [method: set] [key: /favicon.ico] Started setting value in parallel.
[CacheHandler] [handler: composite] [method: set] [key: /manifest.webmanifest] Error: TypeError: Cannot read properties of undefined (reading 'options')
[CacheHandler] [handler: composite] [method: set] [key: /favicon.ico] Error: TypeError: Cannot read properties of undefined (reading 'options')

@themitvp please address those issues and test the code before asking me to do so 🙏🏻 It seems you have not even tried it with the example project.

I'll take a look again once you're ready.

@AyronK Just pushed the update. I ran the example project locally to be sure, and everything works perfectly now 🎉 Sorry about the mix-up earlier!

Copy link
Copy Markdown
Collaborator

@AyronK AyronK left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

@themitvp themitvp marked this pull request as ready for review January 16, 2026 10:28
@AyronK
Copy link
Copy Markdown
Collaborator

AyronK commented Jan 16, 2026

I will move it forward on Monday.

@AyronK AyronK merged commit 985fec4 into fortedigital:master Jan 19, 2026
1 check passed
@themitvp themitvp deleted the feature/ioredis branch January 23, 2026 10:33
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