-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[Workers] tutorials style guide revision #3199
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
Conversation
products/workers/src/content/tutorials/build-a-qr-code-generator/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/build-a-slackbot/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/build-a-slackbot/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/configure-your-cdn/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/configure-your-cdn/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/configure-your-cdn/index.md
Outdated
Show resolved
Hide resolved
@@ -166,7 +166,7 @@ To cache responses in a Workers function, the Cache API provides `cache.match`, | |||
2. If `response` does not exist, get the asset from cloud storage, set it to `response`, and cache it. | |||
3. Return `response` from the function, back to the `fetch` event handler. | |||
|
|||
The `Cache-Control` header is a common way that HTML responses indicate how they should be cached. The Workers implementation respects the `Cache-Control` header, in indicating how assets should be cached on Cloudflare’s CDN. In building a custom asset serving solution, and enabling caching, you should set a custom `Cache-Control` header (in this example, we’ll set it to `public`, and a `max-age` value of `14400` seconds, or four hours). | |||
The `Cache-Control` header is a common way that HTML responses indicate how they should be cached. The Workers implementation respects the `Cache-Control` header, in indicating how assets should be cached on Cloudflare’s CDN. In building a custom asset serving solution, and enabling caching, you should set a custom `Cache-Control` header (in this example, you will set it to `public`, and a `max-age` value of `14400` seconds, or four hours). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `Cache-Control` header is a common way that HTML responses indicate how they should be cached. The Workers implementation respects the `Cache-Control` header, in indicating how assets should be cached on Cloudflare’s CDN. In building a custom asset serving solution, and enabling caching, you should set a custom `Cache-Control` header (in this example, you will set it to `public`, and a `max-age` value of `14400` seconds, or four hours). | |
The `Cache-Control` header is a common way that HTML responses indicate how they should be cached. The Workers implementation respects the `Cache-Control` header, in indicating how assets should be cached on Cloudflare’s CDN. In building a custom asset serving solution, and enabling caching, you should set a custom `Cache-Control` header (in this example, you will set it to `public` and a `max-age` value of `14400` seconds, or four hours). |
products/workers/src/content/tutorials/authorize-users-with-auth0/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/authorize-users-with-auth0/index.md
Outdated
Show resolved
Hide resolved
|
||
1. Update the `handleEvent` function to make a request to your origin. | ||
|
||
While you are currently using Workers Sites, you can update `workers-site/index.js` and replace the Workers Site code with a request to your origin: | ||
While you are currently using Workers Sites, update `workers-site/index.js` and replace the Workers Site code with a request to your origin: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This content belongs to step 1 but it is not indented below it. Consider making these steps two sub-sections, since the text is quite long.
products/workers/src/content/tutorials/authorize-users-with-auth0/index.md
Outdated
Show resolved
Hide resolved
@@ -946,7 +948,7 @@ Following this example, the callback URL for my application is `https://my-auth- | |||
|
|||
In order to safely store user IDs (the sub value from Auth0) in the cookie we set in the browser, you should always refer to them by a value that cannot be easily guessed by someone else. To do this, generate a unique value based on the user’s ID and a salt: a secret value provided by the application. | |||
|
|||
To generate a salt, make a new, random string, and save it as a secret for our application. Previously, this tutorial used `csprng.xyz` API to generate a random piece of `state` to protect against CSRF attacks. Open `https://csprng.xyz/v1/api` in your browser, and copy the `Data` field to your clipboard. If you would like to generate a string yourself, remember that it is important that the salt cannot easily be guessed. | |||
To generate a salt: make a new, random string, and save it as a secret for our application. Previously, this tutorial used `csprng.xyz` API to generate a random piece of `state` to protect against CSRF attacks. Open `https://csprng.xyz/v1/api` in your browser, and copy the `Data` field to your clipboard. If you would like to generate a string yourself, remember that it is important that the salt cannot easily be guessed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To generate a salt: make a new, random string, and save it as a secret for our application. Previously, this tutorial used `csprng.xyz` API to generate a random piece of `state` to protect against CSRF attacks. Open `https://csprng.xyz/v1/api` in your browser, and copy the `Data` field to your clipboard. If you would like to generate a string yourself, remember that it is important that the salt cannot easily be guessed. | |
To generate a salt: make a new, random string, and save it as a secret for your application. Previously, this tutorial used `csprng.xyz` API to generate a random piece of `state` to protect against CSRF attacks. Open `https://csprng.xyz/v1/api` in your browser, and copy the value of the `Data` field to the clipboard. If you would like to generate a string yourself, remember that it is important that the salt cannot easily be guessed. |
products/workers/src/content/tutorials/deploy-a-static-wordpress-site/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/deploy-a-static-wordpress-site/index.md
Show resolved
Hide resolved
products/workers/src/content/tutorials/github-sms-notifications-using-twilio/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/localize-a-website/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/localize-a-website/index.md
Outdated
Show resolved
Hide resolved
Pedro's suggestions Co-authored-by: Pedro Sousa <[email protected]> Co-authored-by: Luke Edwards <[email protected]>
Co-authored-by: Pedro Sousa <[email protected]>
Co-authored-by: Pedro Sousa <[email protected]> Co-authored-by: Luke Edwards <[email protected]>
products/workers/src/content/tutorials/build-a-jamstack-app/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/deploy-a-static-wordpress-site/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/configure-your-cdn/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/deploy-a-static-wordpress-site/index.md
Outdated
Show resolved
Hide resolved
products/workers/src/content/tutorials/localize-a-website/index.md
Outdated
Show resolved
Hide resolved
our -> your
…s-using-twilio/index.md Webhooks -> webhook Co-authored-by: Pedro Sousa <[email protected]>
…th0/index.md Co-authored-by: Pedro Sousa <[email protected]>
…th0/index.md pedro's suggestion Co-authored-by: Pedro Sousa <[email protected]>
…th0/index.md pedro's suggestion Co-authored-by: Pedro Sousa <[email protected]>
No description provided.