You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: files/en-us/web/html/element/input/number/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -419,7 +419,7 @@ After declaring a few variables, an event listener is added to the `button` to c
419
419
420
420
## Accessibility
421
421
422
-
The implicit [role](/en-US/docs/Web/Accessibility/ARIA/Roles) for the `<input type="number">` element is [`spinbutton`](/en-US/docs/Web/Accessibility/ARIA/Roles/spinbutton_role). If spinbutton is not an important feature for your form control, consider *not* using `type="number"`. Instead, use [`inputmode="numeric"`](/en-US/docs/Web/HTML/Global_attributes/inputmode) along with a [`pattern`](/en-US/docs/Web/HTML/Attributes/pattern) attribute that limits the characters to numbers and associated characters. With `<input type="number">`, there is a risk of users accidentally incrementing a number when they’re trying to do something else. Additionally, if users try to enter something that’s not a number, there’s no explicit feedback about what they’re doing wrong.
422
+
The implicit [role](/en-US/docs/Web/Accessibility/ARIA/Roles) for the `<input type="number">` element is [`spinbutton`](/en-US/docs/Web/Accessibility/ARIA/Roles/spinbutton_role). If spinbutton is not an important feature for your form control, consider *not* using `type="number"`. Instead, use [`inputmode="numeric"`](/en-US/docs/Web/HTML/Global_attributes/inputmode) along with a [`pattern`](/en-US/docs/Web/HTML/Attributes/pattern) attribute that limits the characters to numbers and associated characters. With `<input type="number">`, there is a risk of users accidentally incrementing a number when they're trying to do something else. Additionally, if users try to enter something that's not a number, there's no explicit feedback about what they're doing wrong.
423
423
424
424
Also consider using the [`autocomplete`](/en-US/docs/Web/HTML/Attributes/autocomplete) attribute to help users complete forms more quickly and with fewer chances of errors. For example, to enable autofill on a zip code field, set `autocomplete="postal-code"`.
Copy file name to clipboardExpand all lines: files/en-us/web/html/element/source/index.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -80,12 +80,12 @@ This element includes the [global attributes](/en-US/docs/Web/HTML/Global_attrib
80
80
- : The [MIME media type of the resource](/en-US/docs/Web/Media/Formats/Image_types), optionally with a [`codecs` parameter](/en-US/docs/Web/Media/Formats/codecs_parameter).
81
81
82
82
- {{htmlattrdef("src")}}
83
-
- : Required if the `source` element’s parent is an {{HTMLElement("audio")}} and {{HTMLElement("video")}} element, but not allowed if the `source` element’s parent is a {{HTMLElement("picture")}} element.
83
+
- : Required if the `source` element's parent is an {{HTMLElement("audio")}} and {{HTMLElement("video")}} element, but not allowed if the `source` element's parent is a {{HTMLElement("picture")}} element.
84
84
85
85
Address of the media resource.
86
86
87
87
- {{htmlattrdef("srcset")}}
88
-
- : Required if the `source` element’s parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element’s parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
88
+
- : Required if the `source` element's parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element's parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
89
89
90
90
A list of one or more strings, separated by commas, indicating a set of possible images represented by the source for the browser to use. Each string is composed of:
91
91
@@ -96,22 +96,22 @@ This element includes the [global attributes](/en-US/docs/Web/HTML/Global_attrib
96
96
Each string in the list must have at least a width descriptor or a pixel density descriptor to be valid. Among the list, there must be only one string containing the same tuple of width descriptor and pixel density descriptor. The browser chooses the most adequate image to display at a given point of time.
97
97
98
98
- {{htmlattrdef("sizes")}}
99
-
- : Allowed if the `source` element’s parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element’s parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
99
+
- : Allowed if the `source` element's parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element's parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
100
100
101
101
A list of source sizes that describes the final rendered width of the image represented by the source. Each source size consists of a comma-separated list of media condition-length pairs. This information is used by the browser to determine, before laying the page out, which image defined in {{htmlattrxref("srcset", "source")}} to use. Please note that `sizes` will have its effect only if width dimension descriptors are provided with `srcset` instead of pixel ratio values (200w instead of 2x for example).
102
102
103
103
- {{htmlattrdef("media")}}
104
-
- : Allowed if the `source` element’s parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element’s parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
104
+
- : Allowed if the `source` element's parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element's parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
105
105
106
106
[Media query](/en-US/docs/Web/CSS/Media_Queries) of the resource's intended media.
107
107
108
108
- {{htmlattrdef("height")}}
109
-
- : Allowed if the `source` element’s parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element’s parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
109
+
- : Allowed if the `source` element's parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element's parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
110
110
111
111
The intrinsic height of the image, in pixels. Must be an integer without a unit.
112
112
113
113
- {{htmlattrdef("width")}}
114
-
- : Allowed if the `source` element’s parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element’s parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
114
+
- : Allowed if the `source` element's parent is a {{HTMLElement("picture")}} element, but not allowed if the `source` element's parent is an {{HTMLElement("audio")}} or {{HTMLElement("video")}} element.
115
115
116
116
The intrinsic width of the image in pixels. Must be an integer without a unit.
Copy file name to clipboardExpand all lines: files/en-us/web/http/basics_of_http/mime_types/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,7 @@ Per the current relevant standards, JavaScript content should always be served u
156
156
No other MIME types are considered valid for JavaScript, and using any MIME type other than`text/javascript` may result in scripts that do not load or run.
157
157
158
158
You may find some JavaScript content incorrectly served with a `charset` parameter as part of the MIME type — as an attempt to specify the character set for the script content.
159
-
That `charset` parameter isn’t valid for JavaScript content, and in most cases will result in a script failing to load.
159
+
That `charset` parameter isn't valid for JavaScript content, and in most cases will result in a script failing to load.
Copy file name to clipboardExpand all lines: files/en-us/web/http/caching/index.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Personalized contents are usually controlled by cookies, but the presence of a c
39
39
40
40
Also, since the private cache requires `private`, you may think that the shared cache requires `public` — but that is not quite true. A shared cache will store a response without needing `public` as long as `max-age` is given.
41
41
42
-
If the response has an `Authorization` header, it cannot be stored in either the private cache or the shared cache, even if it has `max-age` — and `public` can be used to allow such a case. But if you are not using basic authentication and do not have an `Authorization` header, then there is no need to add `public`; it’s just a waste of bytes in that case.
42
+
If the response has an `Authorization` header, it cannot be stored in either the private cache or the shared cache, even if it has `max-age` — and `public` can be used to allow such a case. But if you are not using basic authentication and do not have an `Authorization` header, then there is no need to add `public`; it's just a waste of bytes in that case.
43
43
44
44
### Shared cache
45
45
@@ -75,7 +75,7 @@ Cache-Control: no-store
75
75
76
76
For example, Varnish uses VCL-based logic to handle cache storage, while service workers in combination with the Cache API allow you to create that logic in JavaScript.
77
77
78
-
That means if a managed cache intentionally ignores a `no-store` directive, there is no need to perceive it as being "non-compliant" with the standard. What you should do is, avoid using kitchen-sink headers, but carefully read the documentation of whatever managed-cache mechanism you’re using, and ensure you’re controlling the cache properly in the ways provided by the mechanism you’ve chosen to use.
78
+
That means if a managed cache intentionally ignores a `no-store` directive, there is no need to perceive it as being "non-compliant" with the standard. What you should do is, avoid using kitchen-sink headers, but carefully read the documentation of whatever managed-cache mechanism you're using, and ensure you're controlling the cache properly in the ways provided by the mechanism you've chosen to use.
79
79
80
80
Note that some CDNs provide their own headers that are effective only for that CDN (for example, `Surrogate-Control`). Currently, work is underway to define a [`CDN-Cache-Control`](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-targeted-cache-control) header to standardize those.
The server will respond with `304 Not Modified` if the content has not changed since the specified time.
210
210
211
-
Since this response only indicates "no change", there is no response body — instead there’s just a status code — so the transfer size is extremely small.
211
+
Since this response only indicates "no change", there is no response body — instead there's just a status code — so the transfer size is extremely small.
However, that usage of `max-age=0` is a remnant of the fact that many implementations prior to HTTP/1.1 were unable to handle the `no-cache` directive — and so to deal with that limitation, `max-age=0` was used as a workaround.
292
292
293
-
But now that HTTP/1.1-conformant servers are widely deployed, there’s no reason to ever use that `max-age=0`-and-`must-revalidate` combination — you should instead just use `no-cache`.
293
+
But now that HTTP/1.1-conformant servers are widely deployed, there's no reason to ever use that `max-age=0`-and-`must-revalidate` combination — you should instead just use `no-cache`.
294
294
295
295
## Don't cache
296
296
297
297
The `no-cache` directive does not prevent storage of responses, but instead prevents reuse of responses without revalidation.
298
298
299
-
If you don’t want a response stored in any cache, use `no-store`.
299
+
If you don't want a response stored in any cache, use `no-store`.
You may think adding `no-store` would be the right way to opt out from caching.
360
360
361
-
However, it’s basically not recommended to grant `no-store` easily, because you lose many advantages that HTTP and browsers have, including the browser’s back/forward cache.
361
+
However, it's basically not recommended to grant `no-store` easily, because you lose many advantages that HTTP and browsers have, including the browser's back/forward cache.
362
362
363
363
Therefore, to get the advantages of the full feature set of the web platform, prefer the use of `no-cache` in combination with `private`.
364
364
@@ -410,7 +410,7 @@ Cache-Control: no-cache
410
410
411
411
(The requests from Chrome, Edge, and Firefox look very much like the above; the requests from Safari will look a bit different.)
412
412
413
-
Since that’s not a conditional request with `no-cache`, you can be sure you’ll get a `200 OK` from the origin server.
413
+
Since that's not a conditional request with `no-cache`, you can be sure you'll get a `200 OK` from the origin server.
414
414
415
415
That behavior is also defined in the [Fetch](https://fetch.spec.whatwg.org/#http-network-or-cache-fetch) standard and can be reproduced in JavaScript by calling `fetch()` with the cache mode set to `reload` (note that it's not `force-reload`):
416
416
@@ -455,7 +455,7 @@ You may want to overwrite that response once it expired on the server, but there
455
455
456
456
One of the methods mentioned in the specification is to send a request for the same URL with an unsafe method such as `POST` — but that is usually difficult to do so intentionally in many clients.
457
457
458
-
There is also a specification for a `Clear-Site-Data: cache` header and value, but [not all browsers support it](https://groups.google.com/a/mozilla.org/g/dev-platform/c/I939w1yrTp4) — and even when it’s used, it is only affects browser caches, but has no effect on intermediate caches.
458
+
There is also a specification for a `Clear-Site-Data: cache` header and value, but [not all browsers support it](https://groups.google.com/a/mozilla.org/g/dev-platform/c/I939w1yrTp4) — and even when it's used, it is only affects browser caches, but has no effect on intermediate caches.
459
459
460
460
Therefore, it should be assumed that any stored response will remain for its `max-age` period unless the user manually performs a reload, force reload, or clear-history action.
461
461
@@ -483,9 +483,9 @@ This section describes the common patterns in designing caches.
483
483
484
484
As mentioned above, the default behavior for caching (that is, for a response without `Cache-Control`) is not simply "don't cache" but implicit caching according to so-called "heuristic caching".
485
485
486
-
To avoid that heuristic caching, it’s preferable to explicitly give all responses a default `Cache-Control` header.
486
+
To avoid that heuristic caching, it's preferable to explicitly give all responses a default `Cache-Control` header.
487
487
488
-
To ensure that by default the latest versions of resources will always be transferred, it’s common practice to make the default `Cache-Control` value include `no-cache`:
488
+
To ensure that by default the latest versions of resources will always be transferred, it's common practice to make the default `Cache-Control` value include `no-cache`:
Don't forget to set the `If-Modified-Since` and `ETag` headers, so that you don't have to re-transmit a resource when reloading. It’s easy to generate those headers for pre-built static files.
581
+
Don't forget to set the `If-Modified-Since` and `ETag` headers, so that you don't have to re-transmit a resource when reloading. It's easy to generate those headers for pre-built static files.
Making a response cacheable over a long period of time by changing the URL when the content changes is called **cache busting**. That technique can be applied to all subresources, such as images.
606
606
607
607
> **Note:** When evaluating the use of `immutable` and QPACK:
608
-
> If you’re concerned that `immutable` changes the predefined value provided by QPACK, consider that
608
+
> If you're concerned that `immutable` changes the predefined value provided by QPACK, consider that
609
609
> in this case, the `immutable` part can be encoded separately by splitting the `Cache-Control` value into two lines — though this is dependent on the encoding algorithm a particular QPACK implementation uses.
That setting is appropriate for non-personalized HTML — but for a response which gets personalized using cookies (for example, after a login), don’t forget to also specify `private`:
643
+
That setting is appropriate for non-personalized HTML — but for a response which gets personalized using cookies (for example, after a login), don't forget to also specify `private`:
644
644
645
645
```http
646
646
200 OK HTTP/1.1
@@ -658,9 +658,9 @@ Most web content can be covered by a combination of the two patterns described a
658
658
659
659
### More about managed caches
660
660
661
-
With the method described in previous sections, subresources can be cached for a long time by using cache busting, but main resources (which are usually HTML documents) can’t be.
661
+
With the method described in previous sections, subresources can be cached for a long time by using cache busting, but main resources (which are usually HTML documents) can't be.
662
662
663
-
Caching main resources is difficult because, using just standard directives from the HTTP Caching specification, there’s no way to actively delete cache contents when content is updated on the server.
663
+
Caching main resources is difficult because, using just standard directives from the HTTP Caching specification, there's no way to actively delete cache contents when content is updated on the server.
664
664
665
665
However, it is possible by deploying a managed cache such as a CDN or service worker.
0 commit comments