PDA

View Full Version : What does ".js?" + MD5 do . . . ?



WebGyver
11 Oct 2007, 9:58 AM
Perhaps I missed something somewhere, but having tried to Google this issue, I give in.

Lately, I've been noticing other web developers using external JavaScript files like so:


src="/js_progress_popup.js?903ebf6a8ae9e13c710506fbb06841b4"

It looks as though they are adding an MD5 string to the URL, but what in the world does that do? Looking at the actual JavaScript files, there is nothing in the code that even checks for any kind of query string value.

However, I am suspecting that taking this approach might have some benefits . . . does anybody know? Please?

devnull
11 Oct 2007, 10:26 AM
I would guess this is to help prevent the files from being cached by making sure each request is unique.

patspam
11 Oct 2007, 10:42 PM
By default Ext.Ajax.request (http://extjs.com/deploy/ext-2.0-alpha1/docs/?class=Ext.Ajax) will do this too in the form of a _dc param (aka the cache-buster). To disable it set disableCaching to false (explained in the linked API docs).

hendricd
12 Oct 2007, 6:51 AM
It's commonly used to obfuscate/encrypt (privacy) request parameters and their values to prevent snooping and url scraping. The server (ASP/PSP..) usually re-writes any url embedded in the page before serving it up.

It also ensures (intentionally or not) that caching is not used as a result.