Hi,
My web hosting company has just enabled http/2.
As my website relies on CDN hosted resources for styles and js libs, the only advantage I see for this new configuration is for preloading the images contained into the posts. So my idea was to list all the images of each post into the Jekyll header:
---
layout: post
title: "Page create a new user"
description: "bla bla"
thumbnail: /images/posts/thumbnails/Add_employee.png
images:
- "/images/posts/article1/hey.png"
- "/images/posts/article1/hop.png"
- "/images/posts/article1/haha.png"
published: true
---
And then to generate the .htaccess as followed:
{% for post in site.posts %}
<FilesMatch "{{ post.url }}$">
{% for image in post.images %}
Header add Link "<{{image}}>; rel=preload; as=image"
{% endfor %}
<FilesMatch>
{% endfor %}
What do you think of this approach?