Discussion:
[chromium-discuss] SRI to cache JS & CSS - Proposal
Rolandtheking
2018-11-01 16:50:15 UTC
Permalink
Hi,

Is it possible to make the browser cache on SRI as well? I tried it and it
does not seem to cache by SRI.

E.g. if you loaded a page with the following JS in the <head>:
<script src="https://cdnjs.*cloudflare*.com/ajax/libs/jquery/3.3.1/jquery.min.js"
integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"
crossorigin="anonymous"></script>

And the next page has this in it's <head> tag:
<script src="https://ajax.*googleapis*.com/ajax/libs/jquery/3.3.1/jquery.min.js"
integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"
crossorigin="anonymous"></script>
chrome will download both scripts, since the servers are different.(cdnjs.
*cloudflare* vs ajax.*googleapis*.com), and caching is done with the url as
a "unique key".

I propose that this should not be done, since you can *also *cache on the
sha384, because a sha384 uniquely identifies the series of bits and bytes a
server wants to send, a series of bits and bytes already present on the pc
of the user since request 1. Therefore wasting precious bandwidth and time.

Sincerely,
Roland
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...