Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt3): pass rendered HTML to hook#4382

Closed
SebJansen wants to merge 1 commit intonuxt:mainfrom
SebJansen:main
Closed

feat(nuxt3): pass rendered HTML to hook#4382
SebJansen wants to merge 1 commit intonuxt:mainfrom
SebJansen:main

Conversation

@SebJansen
Copy link

@SebJansen SebJansen commented Apr 15, 2022

🔗 Linked issue

Issue: nuxt/nuxt#13720
Discussion: https://github.com/nuxt/framework/discussions/4334

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [] 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Nuxt 3 doesn't have a hook that passes the rendered HTML. Having this hook is critical for having caching work on Cloudflare Workers. The change introduces a new hook called page:rendered with the rendered HTML as a parameter, so that third parties can save it to caches such as Cloudflare Workers and Redis. The change is minimal and doesn't introduce breaking changes. I have tested the change locally, and it works as described. I desperately need this change to be able to deploy a production site.

See Cloudflare's docs for more context: https://developers.cloudflare.com/workers/runtime-apis/cache/.

This resolves issue nuxt/nuxt#13720.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Apr 15, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit 19ed0d3
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6259802ff5241f0008f2d1d6
😎 Deploy Preview https://deploy-preview-4382--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pi0
Copy link
Member

pi0 commented Jul 21, 2022

Hi @SebJansen. The hook you want will be introduced with #6042 but I will later explain in your main issue. Nuxt 3 has Nitro pack with builtin cache rules and Abstract Storage. It will allow much easier to achieve the same goal to persist HTML cache in any storage.

@pi0 pi0 closed this Jul 21, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants