Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: GTMETRIX Add Expires headers #8

Closed
sylhare opened this issue Oct 31, 2017 · 3 comments
Closed

Enhancement: GTMETRIX Add Expires headers #8

sylhare opened this issue Oct 31, 2017 · 3 comments

Comments

@sylhare
Copy link
Owner

sylhare commented Oct 31, 2017

Referring to an item of #6 we will look at how to add the "expires headers"

@sylhare
Copy link
Owner Author

sylhare commented Oct 31, 2017

Expire Headers

Definition

Expires headers tell the browser whether they should request a specific file from the server or whether they should grab it from the browser's cache.

The whole idea behind Expires Headers is not only to reduce the load of downloads from the server (constantly downloading the same file when it's unmodified is wasting precious load time) but rather to reduce the number of HTTP requests for the server.

.htaccess

From StackOverFlow: The easiest way to add these headers is a .htaccess file that adds some configuration to your server. If the assets are hosted on a server that you don't control, there's nothing you can do about it.

Note that some hosting providers will not let you use .htaccess files, so we need to check if github allows it.

In Apache HTTP server, .htaccess (hypertext access) is the configuration file that allows for web server configuration. HTML5 Boilerplate includes a number of best practice server rules for making web pages fast and secure, these rules can be applied in the .htaccess file.

.htaccess file example : h5bp/html5-boilerplate

@sylhare sylhare added this to the Enhancing Template milestone Oct 31, 2017
@sylhare
Copy link
Owner Author

sylhare commented Oct 31, 2017

Can I update the HTTP headers with a .htaccess on Github pages?

The answer is no, however we can stimulate html header on html pages using <meta http-equiv> tag.

There seem to be a jekyll plugin named assets but I have not tested it.

I don't think I will create a .htaccess file for the beauty since I will be mostly using the template on Github page.
So Won't Do.

@sylhare
Copy link
Owner Author

sylhare commented Nov 3, 2017

You can leverage browser caching, use apache configuration files if you use something like cloudflare according to this.
You can find some free offer for your blog, but you will have to pay for a bigger website.

I might test it at some point

@sylhare sylhare added this to to do in Type-on-Strap via automation Nov 4, 2017
@sylhare sylhare moved this from to do to Done in Type-on-Strap Nov 4, 2017
OMEGA-Y pushed a commit to OMEGA-Y/OMEGA-Y.github.io that referenced this issue Dec 8, 2020
* csharp: add more docs
OMEGA-Y pushed a commit to OMEGA-Y/OMEGA-Y.github.io that referenced this issue Dec 8, 2020
OMEGA-Y added a commit to OMEGA-Y/OMEGA-Y.github.io that referenced this issue Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Type-on-Strap
  
Done
Development

No branches or pull requests

1 participant