1

I am trying to implement the HTTP/2 protocol on my website and for start i begun senting css, js and fonts using header(Link:). An i can see in my inspector, the files are sent through headers, because Initiator is set to "Other" and all load simultaneously, but after a second the same files are fetched again. I have implemented this method on another site and works perfectly, but on this one i think this is not right.

The header i sent is this:

header("Link: </assets/style.min.css>; rel=preload; as=style,</assets/bundle.min.js>; rel=preload; as=script, </uploads/albums/8/b/3085_1520593221_Shredders_.jpg>; rel=preload;as=image, </assets/fonts/PFBeauSansPro-Bold/PFBeauSansPro-Bold.woff>; rel=preload;as=font, </assets/fonts/PFBeauSansPro-Italic/PFBeauSansPro-Italic.woff>;rel=preload;as=font, </assets/fonts/PFBeauSansPro-Light/PFBeauSansPro-Light.woff>;rel=preload;as=font");

The website is https://www.continental.com.gr. Server is running Nginx

DecoderNT
  • 1,054
  • 10
  • 19
  • Don't see this and you haven't included a screenshot. I see you have changed the link header on this site so did that solve the issue? – Barry Pollard Mar 21 '18 at 07:27
  • 1
    Btw one reason for fonts is if you do not add the crossorigin attribute: https://stackoverflow.com/questions/49268352/preload-font-awesome – Barry Pollard Mar 21 '18 at 08:10
  • hey Barry, about the font, it's local, no need for crs. The strange thing is that, on the first load of page, js is fetched once from push, but on the second load, the pushed file is cached, but the also requests from server the js to load again.. – DecoderNT Mar 21 '18 at 09:17
  • 1
    Fonts need crossorigin for preload even if locally hosted. Weird but true. For JavaScript it sounds like you either forgot the “as=script” attribute or mistyped the filename. A screenshot would help. – Barry Pollard Mar 21 '18 at 10:43

0 Answers0