gruntjs.com icon indicating copy to clipboard operation
gruntjs.com copied to clipboard

Add Expires headers

Open XhmikosR opened this issue 9 years ago • 10 comments

Maybe also remove ETag while at it.

XhmikosR avatar Mar 23 '16 20:03 XhmikosR

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

XhmikosR avatar Jul 20 '16 08:07 XhmikosR

Also add cache busting for static files.

XhmikosR avatar Jan 15 '17 08:01 XhmikosR

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

XhmikosR avatar Feb 19 '17 22:02 XhmikosR

@XhmikosR How can I help?

aulvi avatar Feb 20 '17 21:02 aulvi

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" [email protected] 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 avatar Feb 20 '17 21:02 XhmikosR

@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.

XhmikosR avatar Mar 13 '17 09:03 XhmikosR

@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?

aulvi avatar Mar 21 '17 23:03 aulvi

@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 avatar Mar 26 '17 09:03 XhmikosR

@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 avatar May 23 '17 16:05 XhmikosR

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. :/

XhmikosR avatar May 23 '17 17:05 XhmikosR