# |
Dec 4th 2017, 20:01 |
inoas |
in chromes inspector (the only thing chrome is good for) you can see the http2 preload and prefetch headers |
# |
Dec 4th 2017, 20:00 |
inoas |
afair |
# |
Dec 4th 2017, 19:59 |
inoas |
and I think it is woff2 only because http2 push is only supported by woff2 clients anyway |
# |
Dec 4th 2017, 19:59 |
inoas |
for any subsequent http2 request there is none (if the font is in the cache) |
# |
Dec 4th 2017, 19:59 |
inoas |
that means for the first request (no cache) there is a small flash of loading font |
# |
Dec 4th 2017, 19:58 |
inoas |
and the fonts are set to prefetch |
# |
Dec 4th 2017, 19:58 |
inoas |
in the example above the above the fold css does not complain with pagespeed |
# |
Dec 4th 2017, 19:58 |
inoas |
the browser already knows about your ressources |
# |
Dec 4th 2017, 19:58 |
inoas |
and then use regular html->css() |
# |
Dec 4th 2017, 19:58 |
inoas |
but as a PoC you can just try the header commands |
# |
Dec 4th 2017, 19:57 |
inoas |
<?php if (config('debug') === true) : ?> probably doesnt exist |
# |
Dec 4th 2017, 19:57 |
inoas |
(.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] <= thatfor |
# |
Dec 4th 2017, 19:57 |
inoas |
jfyi |
# |
Dec 4th 2017, 19:57 |
inoas |
http2 only runs on https |
# |
Dec 4th 2017, 19:57 |
admad |
thanks, i'll report back after trying out |
# |
Dec 4th 2017, 19:56 |
inoas |
both 100% page speed |
# |
Dec 4th 2017, 19:56 |
inoas |
it is mixed HTTP2/HTTP1 optimization |
# |
Dec 4th 2017, 19:56 |
inoas |
https://gist.github.com/inoas/2ac1467f83c83af3ea9a41afda905a08 |
# |
Dec 4th 2017, 19:56 |
inoas |
don't complain about the stuff that should indeed be in middleware or controller context @ response/header() ;-) |
# |
Dec 4th 2017, 19:52 |
admad |
inoas: gimme the 35 lines :slightly_smiling_face: |
# |
Dec 4th 2017, 19:49 |
inoas |
next stop --- fighting apache cors settings to fetch fonts from static-domain being on domin |
# |
Dec 4th 2017, 19:47 |
inoas |
I mean... I need 35lines of js to load jquery so that other scripts can be loaded once jquery is loaded so that I can load jquery deferred... sure. |
# |
Dec 4th 2017, 19:47 |
inoas |
makes most of inlining, sprite maps, ugly js hacks unnecessary |
# |
Dec 4th 2017, 19:46 |
inoas |
http2 solved a lot of those ugly problems |
# |
Dec 4th 2017, 19:46 |
inoas |
inline css/js or Filament loadCSS |
# |
Dec 4th 2017, 19:45 |
inoas |
idea? http2 is on 80%+ devices |
# |
Dec 4th 2017, 19:45 |
inoas |
if (str_starts_with(env('SERVER_PROTOCOL'), 'HTTP/2') === true) { header(sprintf('Link: <%s>; rel=preload; as=style', $this->Url->assetUrl($criticalCssAsset)), false); ... you can probably make it a lot cleaner but that's the idea |
# |
Dec 4th 2017, 19:45 |
admad |
in an ideal world sure |
# |
Dec 4th 2017, 19:44 |
inoas |
and push/preload |
# |
Dec 4th 2017, 19:44 |
inoas |
just use http2 :) |
# |
Dec 4th 2017, 19:44 |
inoas |
no |
# |
Dec 4th 2017, 19:44 |
inoas |
haha |
# |
Dec 4th 2017, 19:44 |
admad |
show them a stupid spinner :slightly_smiling_face: |
# |
Dec 4th 2017, 19:43 |
inoas |
should I show you in a few lines how to get rid of flicker ;) |
# |
Dec 4th 2017, 19:43 |
inoas |
admad you gotta understand the tech ;) |
# |
Dec 4th 2017, 19:43 |
inoas |
but that doesnt always work |
# |
Dec 4th 2017, 19:43 |
inoas |
and we cannot do anything about it unless we cache their scripts on our servers somehow |
# |
Dec 4th 2017, 19:42 |
inoas |
some projects use so much SEM-shit... and we cannot get past say 80 page speed |
# |
Dec 4th 2017, 19:42 |
inoas |
but the tards somewhere else |
# |
Dec 4th 2017, 19:42 |
inoas |
admad well thats not the fault of pagespeed |
# |
Dec 4th 2017, 19:39 |
admad |
..and things like loading fonts and css in <head>. Fuckers you expect users to see flicker of styles being applied and fonts being switched once DOM is ready? |