Permalink
Browse files

Clientside JS caching is now off in disableCaching

* In dev mode (silken.DisableCaching) client-side caching is now turned.
* Minor documentation update to highlight difference with Plovr relating
 to a resent question asked.
  • Loading branch information...
1 parent e61aee7 commit 75b5e700533904b1dd44024425e96e1b4a03f4fa @codedance committed May 21, 2012
Showing with 17 additions and 2 deletions.
  1. +8 −0 README.md
  2. +1 −1 pom.xml
  3. +8 −1 src/main/java/com/papercut/silken/SilkenServlet.java
View
@@ -640,6 +640,14 @@ the [Htmleasy Playground Project](http://code.google.com/p/htmleasy/downloads/li
This is a pre-assembled Google App Engine Eclipse project demonstrating
Htmleasy and includes some Silken examples.
+##Miscellaneous Questions
+
+**Q:** What is the difference between Plovr and Silken?
+
+**A:** [Polvr](http://plovr.com/) dynamtically compiles JavaScript. Silken is
+designed to assist with the development of *both* the server-side Java and
+client-side JavaScript Closure templates.
+
##Future
Silken's development is supported by [PaperCut
View
@@ -4,7 +4,7 @@
<groupId>com.papercut.silken</groupId>
<artifactId>silken</artifactId>
<packaging>jar</packaging>
- <version>2012-05-14</version>
+ <version>2012-05-14-SNAPSHOT</version>
<name>silken</name>
<url>https://github.com/codedance/silken</url>
<description>Silken - a nicer tasting Soy Tofu (Google Closure Templates)</description>
@@ -273,7 +273,14 @@ private void doRequest(HttpServletRequest req, HttpServletResponse resp) throws
resp.setContentType(JS_CONTENT_TYPE);
resp.setCharacterEncoding(UTF8_ENCODING);
- resp.setHeader("Cache-Control", "max-age=" + Long.toString(config.getJavaScriptCacheMaxAge()));
+
+ // If we're in development mode, turn of JS browser caching as well.
+ if (config.isDisableCaching()) {
+ resp.setHeader("Cache-Control", "no-cache");
+ } else {
+ resp.setHeader("Cache-Control", "max-age=" + Long.toString(config.getJavaScriptCacheMaxAge()));
+ }
+
resp.getWriter().print(templateRenderer.provideAsJavaScript(namespace, locale));
return;
}

0 comments on commit 75b5e70

Please sign in to comment.