Skip to content

Add docs for Cloudflare Pages deployment#353

Open
0x62 wants to merge 1 commit into
vite-pwa:mainfrom
DiamondHandsHotel:main
Open

Add docs for Cloudflare Pages deployment#353
0x62 wants to merge 1 commit into
vite-pwa:mainfrom
DiamondHandsHotel:main

Conversation

@0x62

@0x62 0x62 commented Aug 4, 2022

Copy link
Copy Markdown

Description

Adds deployment details for Cloudflare Pages as per Discord discussions

@netlify

netlify Bot commented Aug 4, 2022

Copy link
Copy Markdown

Deploy Preview for vite-plugin-pwa ready!

Name Link
🔨 Latest commit 7290843
🔍 Latest deploy log https://app.netlify.com/sites/vite-plugin-pwa/deploys/62ec1aa8a5ba21000717765e
😎 Deploy Preview https://deploy-preview-353--vite-plugin-pwa.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.

@userquin

userquin commented Aug 4, 2022

Copy link
Copy Markdown
Member

@0x62 thx

You need to add the link in the index.md in deployment folder and also the entry in the Deployment object in the docs/.vitepress/config.ts module

@YoRHa-A5

Copy link
Copy Markdown

Maybe add https://kit.svelte.dev/docs/adapter-cloudflare#notes and https://developers.cloudflare.com/pages/platform/headers/ as references?
Had to do some digging before I knew where to put the _headers file :D

00o-sh pushed a commit to TheTechNetwork/it-tools that referenced this pull request Dec 31, 2025
Add _headers file to configure proper MIME types and caching
for PWA assets on Cloudflare Pages deployment.

Key configurations:
- manifest.webmanifest: Correct MIME type (application/manifest+json)
- sw.js: No caching to ensure updates
- workbox files: Long-term cache (immutable)
- assets/: Long-term cache for hashed files
- index.html: No cache to ensure freshness

This fixes PWA installation issues on Cloudflare Pages where
the manifest wasn't being served with the correct Content-Type
header.

See: vite-pwa/vite-plugin-pwa#353
00o-sh pushed a commit to TheTechNetwork/it-tools that referenced this pull request Dec 31, 2025
Add _headers file with the exact configuration recommended by
vite-plugin-pwa documentation for Cloudflare Pages deployments.

Configuration:
- /: No caching for root (max-age=0, s-maxage=0)
- /assets/*: Long-term cache for hashed assets (immutable)
- /workbox-*: Long-term cache for workbox runtime (immutable)
- /manifest.webmanifest: Correct MIME type (application/manifest+json)

This ensures the PWA manifest is served with the correct Content-Type
header and implements proper cache strategies for PWA assets.

Ref: vite-pwa/vite-plugin-pwa#353
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.

4 participants