Index: mapwms.c
===================================================================
--- mapwms.c	(revision 7459)
+++ mapwms.c	(working copy)
@@ -2196,8 +2196,15 @@
     img = msDrawMap(map, MS_FALSE);
   if (img == NULL)
       return msWMSException(map, nVersion, NULL);
-
   
+  /* Set the HTTP Cache-control headers if they are defined
+     in the map object */
+  const char *http_max_age;
+  if( (http_max_age = msLookupHashTable(&(map->web.metadata), "http_max_age")) ) 
+  {
+    msIO_printf("Cache-Control: max-age=%s\n", http_max_age , 10, 10);
+  }
+  
   msIO_printf("Content-type: %s%c%c",
               MS_IMAGE_MIME_TYPE(map->outputformat), 10,10);
   if (msSaveImage(map, img, NULL) != MS_SUCCESS)

