I have an Apache Tomcat server running. If I have something like:
webapp/
image1.png
Then, I can simply access it using:
example.com/image1.png
Which is perfect, except that I don’t have any control over what headers are being sent. I wish to send specific Expires header for certain MIME-types (like, for image/png). These headers will be static, so I don’t really mind if I have to specify this in some XML file and cannot be dynamic.
Is it possible with Apache Tomcat? The other obvious way is to read from the file and output it to the browser with the appropriate headers, but I think that it might be an overkill.
Use Tomcat Filters for applying this headers.
More Info at Tomcat Filter Documentation