# |
Dec 4th 2017, 20:06 |
inoas |
though it is a customized bs3 with just the grid and responsive utilites and from styles for bootstrapui cakephp3 plugin |
# |
Dec 4th 2017, 20:06 |
inoas |
because f**k pagespeed :E |
# |
Dec 4th 2017, 20:06 |
inoas |
and for http2 I inline load them LOL |
# |
Dec 4th 2017, 20:05 |
inoas |
http2 is one binary channel |
# |
Dec 4th 2017, 20:05 |
inoas |
no point |
# |
Dec 4th 2017, 20:04 |
admad |
why aren't you joining css to reduce requests? for e.g. bootstrap.min.css and base.css |
# |
Dec 4th 2017, 20:04 |
inoas |
caniuse.com/http2 |
# |
Dec 4th 2017, 20:04 |
inoas |
and if you don't believe 80%+ |
# |
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: |