SiegeEngineers / aoe2cm2

Captains Mode for Age of Empires II
https://aoe2cm.net
51 stars 25 forks source link

Add Cache-Control header for assets served from the /public folder #53

Closed lalitpatel closed 4 years ago

lalitpatel commented 4 years ago

I noticed that we do not have a cache-control header set for our static images served from the /public folder. Setting a cache header would greatly reduce the number of request to the server for static assets and also speed up the page load for the end users.

My recommendation is to set cache for 100 days:

cache-control: public, max-age=8640000

Resources

lalitpatel commented 4 years ago

In production, we do not serve the static files via express, but directly via apache/nginx. This would therefore only affect development. I have however configured the header for those two paths in the deployments at aoe2cm.net (production) and cm.aoe2.se (staging) :+1:

Originally posted by @HSZemi in https://github.com/SiegeEngineers/aoe2cm2/pull/54#issuecomment-671906078