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
It would be really helpful if the CacheControl object implemented a custom valueOf in order to compare CacheControl objects.
Use-case: I'm making a bunch of HTTP requests to various 3rd party servers and combining them into a single response. These requests have various Cache-Control headers, but I'd like my API to respond with the most restrive (i.e. least cachable) of the lot.
For instance, if I have a set like this:
max-age: 600, public
max-age: 300, public
I'd need the second of the two. But if I have a set like this:
private
max-age: 600, public
max-age: 300, public
I would need the first one.
I realize it might be difficult to translate the Cache-Control into a number, but I think it's ok if some options produce the same number (i.e. private could be -1 and immutable could be 100000000 or something). Or perhaps different options have different weights?
The text was updated successfully, but these errors were encountered:
It would be really helpful if the CacheControl object implemented a custom valueOf in order to compare CacheControl objects.
Use-case: I'm making a bunch of HTTP requests to various 3rd party servers and combining them into a single response. These requests have various Cache-Control headers, but I'd like my API to respond with the most restrive (i.e. least cachable) of the lot.
For instance, if I have a set like this:
I'd need the second of the two. But if I have a set like this:
I would need the first one.
I realize it might be difficult to translate the Cache-Control into a number, but I think it's ok if some options produce the same number (i.e.
private
could be-1
andimmutable
could be100000000
or something). Or perhaps different options have different weights?The text was updated successfully, but these errors were encountered: