use once per session preload / push

This commit is contained in:
Daniel Micay 2021-02-15 04:23:56 -05:00
parent 2688ca04a5
commit f298ee4b2b
2 changed files with 8 additions and 2 deletions

View File

@ -65,6 +65,11 @@ http {
if_modified_since before; if_modified_since before;
map $http_cookie $preload_resources {
"~*__Host-preload=1" "";
default "</grapheneos.css?29>; rel=preload; as=style, </fonts/roboto_latin.woff2?20>; rel=preload; as=font; crossorigin, </fonts/roboto_bold_latin.woff2?20>; rel=preload; as=font; crossorigin";
}
server { server {
listen 80 backlog=4096; listen 80 backlog=4096;
listen [::]:80 backlog=4096; listen [::]:80 backlog=4096;

View File

@ -1,2 +1,3 @@
add_header Link "</grapheneos.css?29>; rel=preload; as=style, </fonts/roboto_latin.woff2?20>; rel=preload; as=font; crossorigin, </fonts/roboto_bold_latin.woff2?20>; rel=preload; as=font; crossorigin" always; add_header Link $preload_resources always;
http2_push /grapheneos.css?29; add_header Set-Cookie "__Host-preload=1; HttpOnly; Secure; Path=/" always;
http2_push_preload on;