Skip to content

ISR does not seem to work #398

Closed
Closed

Description

@joshudev

Brief Description of the Bug
When using the App directory, calling revalidateTag will delete all entries with the specified tag. When the user browses a page that was tagged with the tag, the page is rebuilt during the request, causing a delay for the user. I would have expected the page to be rebuilt in the background after the request has been served, as happens when using the built-in CacheHandler.

Severity
Major

Frequency of Occurrence
Always

Steps to Reproduce

  1. Navigate to a page '/test' with tag 'xyz'
  2. call revalidateTag('xyz') in an api endpoint - this deletes the cache entries for the tag
  3. Browse to '/test' - the page is rebuilt inline rather than in the background

Expected vs. Actual Behavior
I would expect the page to be rebuilt in the background and the user who initiated the request to be served the stale content.

Environment:

  • OS: MacOS
  • Node.js version: v20.10.0
  • @neshca/cache-handler version: 1.0.5
  • next version: 14.1.0

Attempted Solutions or Workarounds

Impact of the Bug
We would like to containerize our app, building on a remote CI environment using a shared cache, and have ready-to-run testable Containers as built output - and this is a blocker for us

Activity

  1. better-salmon commented on Mar 11, 2024

    @better-salmon
    Contributor

    @joshudev hello!

    When the user browses a page that was tagged with the tag, the page is rebuilt during the request, causing a delay for the user.

    This behavior is not a bug. Native Next.js cache works the same. It makes sense to me because on-demand revalidation is a manual process.

    It is also worth mentioning that pages from the Pages Router are updated synchronously on res.revalidate(pathname), and CacheHandler can not alter this. As a result, such pages are always fresh after revalidation. I think that the App Router pages inherit this aspect of on-demand revalidation.

    I'm converting this issue to discussion.

  2. locked and limited conversation to collaborators on Mar 11, 2024
  3. converted this issue into a discussion #404 on Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions