gruntjs / gruntjs.com

Grunt's Website
https://gruntjs.com
Other
155 stars 83 forks source link

Add Expires headers #174

Open XhmikosR opened 8 years ago

XhmikosR commented 8 years ago

Maybe also remove ETag while at it.

XhmikosR commented 8 years ago

@vladikoff: I have a couple more suggestions for the server. Can you CC whoever is in charge of maintaining the server?

XhmikosR commented 7 years ago

Also add cache busting for static files.

XhmikosR commented 7 years ago

/CC @aulvi for cache busting. Then we can increase the expires date and remove ETags.

aulvi commented 7 years ago

@XhmikosR How can I help?

XhmikosR commented 7 years ago

We need cache busting first and then you will need to bump the expires dates for static files.

On Feb 20, 2017 23:13, "Adam Ulvi" notifications@github.com wrote:

@XhmikosR https://github.com/XhmikosR How can I help?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gruntjs/gruntjs.com/issues/174#issuecomment-281182641, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVVtbN3UE3--gRr0GAzmgptfieSs6_Pks5regIUgaJpZM4H3cNV .

XhmikosR commented 7 years ago

@aulvi: As you can see from https://gtmetrix.com/compare/qKtQlfmm/JQKDpMBV, that is why we need expires date. Currently each static file is being served from our server because it doesn't have any cache header. The https change helped a bit due to http/2 but still it's slow as you can see.

aulvi commented 7 years ago

@XhmikosR Current nginx config simply acts as a reverse proxy to the node app.

Would it be possible for the node app to set the headers and manage the cache busting?

XhmikosR commented 7 years ago

@aulvi: I tried doing this on the Grunt side in https://github.com/gruntjs/gruntjs.com/compare/grunt-usemin

But it has some issues. If we could sort that out, we could just set the headers in Express.js.

Alternatively, we could add cache busting in Express.js but I'd rather do it in preprocess step.

XhmikosR commented 7 years ago

@aulvi: have you changed something on the nginx side to automatically add caste busting?

I see the static assets have a random hash appended to their filename, but Cloudflare doesn't cache them at all.

So, can you explain a little bit what is happening and if the main site is still being built from the master branch?

Thanks.

XhmikosR commented 7 years ago

Scratch my previous comment; I had accidentally sneaked in my grunt-usemin changes in master. Cleaned up the patches and forced pushed and made a new tag.

So this issue is still valid. :/