Use simplecach for JS

I am trying to use simplecache for Javascript.  I followed the documentation and created this code.

//Register js in cache
$url = elgg_get_simplecache_url('js', 'skype/skype-uri');
elgg_register_js('skype-uri', $url);

I created a skype-uri.php with the JS in it in /mod/skype/views/default/js/skype/

The JS file does not load. If you try to open the js file as show in the SRC of the HTML, it says

Cache error: bad request

I tried it for another plugin which did not use caching and there it worked. Do I need to change the JS itself ?