Case Sensitive URLs

Web developers often spend a lot of time and effort optimizing their web pages to perform better. One of my favorite optimizations is properly setting content expirations to specify how long the client should consider the content to be “fresh”. Here are some good references for caching MDN and RFC 9111. These techniques allow the […]


This content originally appeared on Web Performance Calendar and was authored by Robert Boedigheimer

Web developers often spend a lot of time and effort optimizing their web pages to perform better. One of my favorite optimizations is properly setting content expirations to specify how long the client should consider the content to be “fresh”. Here are some good references for caching MDN and RFC 9111. These techniques allow the browser to reuse content from its local cache or a shared network cache, which is often faster and reduces load on the origin server. An important thing to remember is that browsers consider URLs to be case sensitive (most web servers do as well, Microsoft IIS does not).

Mixed Case URLs

Here is an example web page that demonstrates some variations in image URL case.
HTML example with various cases for image src attribute

Impact on Caching

Use your favorite tracing tool to see the additional downloads due to mixed case URLs.

Conclusion

Caching content is great performance improvement, and an easy way to ensure that browsers are not redownloading the same resource is to standardize how to properly case URLs. Production web pages are probably not including that same resource multiple times from the same page, but it is common that without rules developers will use their own style for URLs across a website. To avoid that I have just adopted using all lower case URLs. Don’t put in all the effort to cache resources, only to have them not be used due to differently cased URLs.


This content originally appeared on Web Performance Calendar and was authored by Robert Boedigheimer


Print Share Comment Cite Upload Translate Updates
APA

Robert Boedigheimer | Sciencx (2023-12-31T21:44:06+00:00) Case Sensitive URLs. Retrieved from https://www.scien.cx/2023/12/31/case-sensitive-urls/

MLA
" » Case Sensitive URLs." Robert Boedigheimer | Sciencx - Sunday December 31, 2023, https://www.scien.cx/2023/12/31/case-sensitive-urls/
HARVARD
Robert Boedigheimer | Sciencx Sunday December 31, 2023 » Case Sensitive URLs., viewed ,<https://www.scien.cx/2023/12/31/case-sensitive-urls/>
VANCOUVER
Robert Boedigheimer | Sciencx - » Case Sensitive URLs. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/12/31/case-sensitive-urls/
CHICAGO
" » Case Sensitive URLs." Robert Boedigheimer | Sciencx - Accessed . https://www.scien.cx/2023/12/31/case-sensitive-urls/
IEEE
" » Case Sensitive URLs." Robert Boedigheimer | Sciencx [Online]. Available: https://www.scien.cx/2023/12/31/case-sensitive-urls/. [Accessed: ]
rf:citation
» Case Sensitive URLs | Robert Boedigheimer | Sciencx | https://www.scien.cx/2023/12/31/case-sensitive-urls/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.