3 ms·
You should be able to do something like this: - if the resource isn't in cache, download it and note the time it took. - if the current site has requested the
by Asooka 5y ago
You should be able to do something like this:
- if the resource isn't in cache, download it and note the time it took.
- if the current site has requested the resource before, just return it instantly.
- otherwise, wait the exact same time it took originally.
With this the first request a site makes for a resource will always take the same time and you have no way of knowing if that was the first time it was downloaded or if it's served from cache. It's obviously not quite that simple, you'll need to factor in which connection is in use etc, but it should be possible to keep cross site caching.