I have an Apache with http2, and I have made a server push of files which I would like to save on browser cache, but it doesnt and I dont know why.
I have made the push with a php file, the following one.
header( 'Link: <'https://www.myweb.com/mypath'>;rel="preload";as="video"', FALSE );
From my point of view, the Server push is working, because I can see the requests to the server in the access_log, but I think that the files should be saved on the browser cache, but It doesnt.
I try to make a server push of a file, and after it, request this file and get it from cache (see on the Network console of Chrome "from cache").
Thanks
All you said was true, and I had it on my code, but the trouble was on the understanding of the Google Chrome Cache saving.
When you send some file with Server Push on an HTTP2 connection, the file requested via server push is sent as response to the client, but Google Chrome does not save it into Google Chrome cache until the file was requested by the browser.
For example: The server sends the response of index.html with its stylesheet.css (this one sent with server push). The stylesheet will only be saved into Google Chrome cache when Google Chrome request the Stylesheet.css(the client has requested only the index html and make a push of the stylesheet). If Google Chrome does not request it, it will be an unclaimed push and it will not be saved into cache.
If you have a success push, and reload the page, you will see "from cache" on Google Chrome.
Thanks for your time.