I would like all the following requests to reach the same static file hosted on Amazon S3, for example:
http://cloudfront.net/js/12345.js
http://cloudfront.net/js/54232.js
http://cloudfront.net/js/76543.js
would all point to a single static file on Amazon S3 such as:
/js/real-file.js
then the javascript code in this real file would be able to get the numbers from the request using something like the following found here:
var scripts = document.getElementsByTagName('script');
var scriptName = scripts[scripts.length-1].src;
I know this would be possible using a query parameter such as:
/js/real-file.js?a=12345
but I would like to know if it's possible to achieve without it.
If not on Amazon, then perhaps using a different CDN service?