We are in the process of rewriting some of our websites and trying to make the most use of browser caching for our users. We have created a group of shared css files that we plan to use as a "corporate branding" across multiple sites that we've created.
The reason for this, we know that browsers will cache a CSS file for a determined length of time. What if I specify the same file name in different sites with a different casing, will it cache both version of the file (even tho they are the same content) or will it recognize that it's the same file, thus ignoring the case of the filename
<link href="http://branding.corporateentity.com/style/screen.css" type="text/css" />
<link href="http://branding.corporateentity.com/style/print.css" type="text/css" />
vs:
<link href="http://branding.corporateentity.com/Style/Screen.css" type="text/css" />
<link href="http://branding.corporateentity.com/Style/Print.css" type="text/css" />
Upper and lower case The Web server is a Unix computer and Unix is case sensitive. When typing in the filenames of your HTML files and related image files you must be consistent. If the filename is all or partly in Upper case, all references to that file must reflect this accurately.
Pseudo-class names are not case-sensitive.
css” is the default name given to any CSS file.
URLs are case-sensitive, so the best thing is to always use a particular case. I recommend making everything lowercase (and separating words with dashes) for simplicity. This is also recommended for your page names and images, for SEO purposes.
Browsers will treat different case as different files since they don't know whether the server is doing the same. Therefore, the browser will not use its cache of style/screen.css
if it sees a link to Style/Screen.css
.
URL's are case sensitive, and browsers follow that standard- a different case is a different file. I would hesitate to use the example above however, because some browsers may not follow the standard protocall (for example, i think Windows is not case sensitive, and wonder if some sad old browsers can't tell the difference between 'file' and 'File').
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With