简体   繁体   中英

Can cache-control header have multiple values?

Cache-Control doesn't seem to work if it has multiple values in Angular 9.

This doesn't work,

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">

but this works

<meta http-equiv="Cache-Control" content="no-store">

Why doesn't the first one work? Is it because Cache-Control shouldn't have multiple values or is it because no-cache , no-store and must-revalidate contradicting themselves and thus rendering the whole meta tag as null ?

As per specs , a header can have multiple values separated by a comma.

Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [ie, #(values)]. It MUST be possible to combine the multiple header fields into one "field-name: field-value" pair, without changing the semantics of the message, by appending each subsequent field-value to the first, each separated by a comma. The order in which header fields with the same field-name are received is therefore significant to the interpretation of the combined field value, and thus a proxy MUST NOT change the order of these field values when a message is forwarded

The problem that you are facing can be because of the order of the properties.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM