getRootPath() . 'public/static/haonav/sw.js'; $js = is_file($path) ? (string)file_get_contents($path) : ''; return Response::create($js)->header([ 'Content-Type' => 'application/javascript; charset=utf-8', 'Service-Worker-Allowed' => '/haonav/', 'Cache-Control' => 'no-cache', ]); } }