-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Changelog update: Announce static asset support for Workers for Platforms #19584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
irvinebroque
merged 4 commits into
cloudflare:production
from
dinasaur404:wfp-static-assets
Jan 31, 2025
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8698741
Add Workers for Platforms static assets changelog
dinasaur404 7f91be4
Add description to Workers for Platforms static assets changelog
dinasaur404 593af96
Changelog update: Announce static asset support for Workers for Platf…
dinasaur404 1a4295b
Update src/content/changelogs-next/2025-01-31-workers-platforms-stati…
dinasaur404 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/content/changelogs-next/2025-01-31-workers-platforms-static-assets.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| title: Workers for Platforms now supports Static Assets | ||
| description: Workers for Platforms customers can now serve static assets for User Workers directly from Cloudflare's global edge | ||
| products: | ||
| - workers-for-platforms | ||
| date: 2025-01-31T17:00:00Z | ||
| --- | ||
|
|
||
| import { Render, TypeScriptExample } from "~/components"; | ||
|
|
||
| Workers for Platforms customers can now attach static assets (HTML, CSS, JavaScript, images) directly to User Workers, removing the need to host separate infrastructure to serve the assets. | ||
|
|
||
| This allows your platform to serve entire front-end applications from Cloudflare’s global edge, utilizing caching for fast load times, while supporting dynamic logic within the same Worker. Cloudflare automatically scales its infrastructure to handle high traffic volumes, enabling you to focus on building features without managing servers. | ||
|
|
||
| ### What you can build | ||
|
|
||
| **Static Sites:** Host and serve HTML, CSS, JavaScript, and media files directly from Cloudflare's network, ensuring fast loading times worldwide. This is ideal for blogs, landing pages, and documentation sites because static assets can be efficiently cached and delivered closer to the user, reducing latency and enhancing the overall user experience. | ||
|
|
||
| **Full-Stack Applications:** Combine asset hosting with Cloudflare Workers to power dynamic, interactive applications. If you're an e-commerce platform, you can serve your customers' product pages and run inventory checks from within the same Worker. | ||
|
|
||
| <TypeScriptExample filename="index.ts"> | ||
| ```ts | ||
| export default { | ||
| async fetch(request, env) { | ||
| const url = new URL(request.url); | ||
|
|
||
| // Check real-time inventory | ||
| if (url.pathname === '/api/inventory/check') { | ||
| const product = url.searchParams.get('product'); | ||
| const inventory = await env.INVENTORY_KV.get(product); | ||
| return new Response(inventory); | ||
| } | ||
|
|
||
| // Serve static assets (HTML, CSS, images) | ||
| return env.ASSETS.fetch(request); | ||
| } | ||
| }; | ||
| ``` | ||
| </TypeScriptExample> | ||
|
|
||
| **Get Started:** | ||
| Upload static assets using the Workers for Platforms API or Wrangler. For more information, visit our [Workers for Platforms documentation.](https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/configuration/static-assets/) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.