The background-image I'm serving is fairly large and I'd like to have it cached permanently. I figure I should send a cache header with a max age of infinity. How can I do this in a clean and proper way. I'm using express (out of the box) and don't have any caching modules.

2 Answers
2

You can setup a middleware handler that can match the path of your static background image and then set a cache-control header. This will set the cache-control header for your image but not for other static resources.