Fixed issues #866 and #868

Dealing with expiration and modification dates (particularly in a Servlet container).

I have only had a chance to test this out in Tomcat 7 (which uses ``jndi:`` URLs for Servlet resources).