Minor changes to use constant useRW

if useRW is true sort parameters are passed on end of 'cached-scripts'
as 'cached-scripts_sp' instead of using 'cached-scripts?s=sp'.