Commit graph

8 commits

Author SHA1 Message Date
Julian
38b3423160
Fix Dead Links in @neshca/cache-handler-redis example README.md (#67415)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?
Updating links to the @neshca/cache-handler documentation that are dead.
### Why?
To improve developer experience (DX) by ensuring README.md links are
functional.
### How?
Edit the Markdown links in the README.md file of the example to point to
the correct URLs.


-->
Hello,

This PR updates dead links in the @neshca/cache-handler-redis example's
README.md to ensure they point to the correct URLs.

Thank you for your review!

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-07-04 15:35:15 +00:00
David Sa
7725047c89
update cache handler version in example (#65330)
### What?
Update the cache-handler package to the latest and changed logic for
opting out of caching during build.

### Why?
The current implementation in the cache-handler-redis example requires
an environment variable check for `REDIS_AVAILABLE` to determine if the
server has already started in order to opt out of caching during build.
This update leverages the `NEXT_PHASE` environment variable instead.

### How?
This updates the environment variable check to leverage the `NEXT_PHASE`
variable so a user doesn't have to manage a new environment variable.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-05-13 14:58:55 -07:00
akfm
10599a4e1e
fix(examples): cache-handler-redis implementation may cause error "Socket already opened" on production (#61978)
### What?

I copied the contents of `cache-handler.js` and tried it, and got an
error `"Socket already opened"`.
ref: https://github.com/caching-tools/next-shared-cache/issues/284
It should be fixed so that it doesn't matter if it is copied.

### Why?

Because `Socket already opened`, so a condition is needed before `await
client.connect()`.

### How?

Add environment variable(`process.env.REDIS_AVAILABLE`) check.
ref:
https://caching-tools.github.io/next-shared-cache/configuration/opt-out-cache-on-build

Co-authored-by: akfm.sato <01047245@CF0286.local>
2024-02-13 23:45:11 +00:00
Arseny
3b46f22bb1
Update Redis Cache example with stabilized API (#60800)
This pull request updates the `cache-handler-redis` example with a
stabilized API. The updated `next.config.js` now uses the stable
`cacheHandler` option instead of the
`experimental.incrementalCacheHandlerPath`.
2024-01-21 02:40:54 +00:00
Steven
4466ba436b
chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00
Arseny
8694ed6a40
Update cache-handler-redis example dependencies (#59458)
This pull request updates the dependencies in the cache-handler-redis
example. It updates the versions of the `@neshca/cache-handler`, which
introduces new features.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-01-10 18:43:03 +00:00
Arseny
10c794a371
examples: Update cache-handler-redis (#58562) 2023-11-16 21:36:55 -06:00
Arseny
e2f3059b48
Add a self-hosted shared cache example (#58000)
### What?

This pull request integrates the exemplary setup for a self-hosted Next.js application utilizing Redis as a shared cache storage. The solution supports caching at both the App and Pages routers in default and standalone modes, as well as partial pre-rendering, facilitated by the [`@neshca/cache-handler`](https://github.com/caching-tools/next-shared-cache/tree/canary/packages/cache-handler) package. The package enables customizing cache handlers and replacing the default cache provided by Next.js seamlessly.

### Why?

The motivation behind this pull request is to provide an example demonstrating how Redis can be used as a shared cache in a self-hosted environment, thereby improving the scalability of hosting multiple instances of a Next.js application.
2023-11-09 14:29:11 +00:00