Properly normalize ref keys used in JS cache