Github pages, HTTP headers

后端 未结 4 1012
北恋
北恋 2020-12-24 01:56

I serve some of my files from my Github pages account. But when I check my \"js\" files\' headers, I saw following:

Last-Modified:Sun, 10 Feb 2013 14:00:46 G         


        
4条回答
  •  温柔的废话
    2020-12-24 02:39

    This is for all the people still having this problem and coming here from google.

    Had the same problem recently. Actually it is possible if you are stubborn enough and wish to use some extra, third party services. What you need to do, is to use free tier heroku app with custom nginx buildpack. This buildpack would work as a proxy pass, which can add/remove HTTP headers as you please.

    You will lose GitHub CDN though, so it may be good idea to leverage another service - cloudflare to do just that (and SSL as a bonus).

    I wrote an article with detailed setup how to do this, if somebody is intereseted: https://www.rzegocki.pl/blog/custom-http-headers-with-github-pages/ - the setup is pretty cumbersome but it works.

提交回复
热议问题