Mobile app version of vmapp.org
Login or Join
Sims2060225

: A css or js of same name from multiple sites or multiple pages of same site When a css/js refers on a webpage it is first downloaded to client machine. From the next time it is referred

@Sims2060225

Posted in: #Browsers #CacheControl

When a css/js refers on a webpage it is first downloaded to client machine. From the next time it is referred from browser cache (if it presents). Please tell me


What happens when multiple sites refer a css/js having same name.
What happens when sub-domains refer a same css/js
What happens when many websites refer css/js from specified cdn like google or some other place.


Please tell me, in such cases, whether browser refers copy from cache or it makes local references according to main sites or something else.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sims2060225

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

What happens when multiple sites refer a css/js having same name.


If they are served from different URLs then the browser will consider them to be different resources and fetch both.


What happens when sub-domains refer a same css/js


If they are served from different URLs then the browser will consider them to be different resources and fetch both. If they refer to the same file then the browser will download the file on the first request and then use a cached copy of the file if appropriate (i.e. not expired).


What happens when many websites refer css/js from specified cdn like
google or some other place.


They will download the file on the first request and then use a cached copy for subsequent requests (if it is not expired).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme