rel_preconnect.sjs 536 B

12345678910111213141516
  1. // Generate response header "Link: <HREF>; rel=preconnect"
  2. // HREF is provided by the request header X-Link
  3. function handleRequest(request, response)
  4. {
  5. response.setHeader("Cache-Control", "no-cache", false);
  6. response.setHeader("Link", "<" +
  7. request.queryString +
  8. ">; rel=preconnect" + ", " +
  9. "<" +
  10. request.queryString +
  11. ">; rel=preconnect; crossOrigin=anonymous");
  12. response.write("check that header");
  13. }