Author: joakime
Date: Wed Sep 26 11:23:41 2007
New Revision: 579747

URL: http://svn.apache.org/viewvc?rev=579747&view=rev
Log:
[MRM-503] Metadata files need Pragma:no-cache response header.
Applied Pragma and Cache-Control headers to maven-metadata.xml requests only.
Added TODO for other filetypes.

Modified:
    
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java

Modified: 
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java?rev=579747&r1=579746&r2=579747&view=diff
==============================================================================
--- 
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
 (original)
+++ 
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
 Wed Sep 26 11:23:41 2007
@@ -146,12 +146,14 @@
         }
         else
         {
-            // Create parent directories that don't exist when writing a file
-            // This actually makes this implementation not compliant to the
-            // WebDAV RFC - but we have enough knowledge
-            // about how the collection is being used to do this reasonably and
-            // some versions of Maven's WebDAV don't
-            // correctly create the collections themselves.
+            /* Create parent directories that don't exist when writing a file
+             * This actually makes this implementation not compliant to the
+             * WebDAV RFC - but we have enough knowledge
+             * about how the collection is being used to do this reasonably and
+             * some versions of Maven's WebDAV don't
+             * correctly create the collections themselves.
+             */
+            
             File rootDirectory = getRootDirectory();
             if ( rootDirectory != null )
             {
@@ -159,6 +161,15 @@
             }
         }
 
+        // MRM-503 - Metadata file need Pragma:no-cache response header.
+        if ( request.getLogicalResource().endsWith( "/maven-metadata.xml" ) )
+        {
+            response.addHeader( "Pragma", "no-cache" );
+            response.addHeader( "Cache-Control", "no-cache" );
+        }
+        
+        // TODO: determine http caching options for other types of files 
(artifacts, sha1, md5, snapshots)
+        
         davServer.process( request, response );
     }
 


Reply via email to