Commits

Don Brown committed 1623c6f

Add expiration of one hour for feeds

Comments (0)

Files changed (3)

src/main/java/servlets/RssInlineServlet.java

 import java.io.StringWriter;
 import java.nio.charset.Charset;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 import static com.google.common.collect.Maps.newHashMap;
 import static java.lang.Integer.parseInt;
 
         String html = retrieveAndRender(rssUrl, req);
         resp.setContentType("text/xml");
+        resp.setDateHeader("Expires", System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1));
+        resp.setHeader("Cache-Control", "public");
 
         byte[] data = html.getBytes(Charset.forName("UTF-8"));
         resp.setContentLength(data.length);

src/main/java/servlets/RssPageServlet.java

 import java.io.StringWriter;
 import java.nio.charset.Charset;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 @Singleton
 public class RssPageServlet extends AbstractPageServlet

src/main/resources/atlassian-plugin.xml

-<atlassian-plugin name='${project.name}' key='${atlassian.plugin.key}' plugins-version="2"
+<atlassian-plugin name='${project.name}' key='remotehtml' plugins-version="2"
         xmlns="https://remoteapps.jira.com/wiki/rest/remotable-plugins/1/installer/schema/atlassian-plugin">
     <plugin-info>
         <description><![CDATA[${project.description}]]></description>
-        <version>${project.version}</version>
-        <vendor name="${project.organization.name}" url="${project.organization.url}"/>
+        <version>1</version>
+        <vendor name="${project.organization.name}" url="http://atlassian.com"/>
         <permissions>
         </permissions>
     </plugin-info>