no caching in browser of dynamic web pages sent by YaCy http

this may prevent unnecessary IO caused by cache storage of the browser

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7207 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 41a93ff565
commit c60aed4435

@ -274,6 +274,9 @@ public final class HTTPDFileHandler {
if (authorization != null && authorization.length() == 0) authorization = null;
final String adminAccountBase64MD5 = switchboard.getConfig(HTTPDemon.ADMIN_ACCOUNT_B64MD5, "");
// cache settings
boolean nocache = path.contains("?") || body != null;
// a bad patch to map the /xml/ path to /api/
if (path.startsWith("/xml/")) {
path = "/api/" + path.substring(5);
@ -388,6 +391,8 @@ public final class HTTPDFileHandler {
}
}
}
if (args != null) nocache = true;
// we are finished with parsing
// the result of value hand-over is in args and argc
@ -504,7 +509,6 @@ public final class HTTPDFileHandler {
//We need tp here
servletProperties templatePatterns = null;
Date targetDate;
boolean nocache = false;
if ((targetClass != null) && (path.endsWith("png"))) {
// call an image-servlet to produce an on-the-fly - generated image

@ -1188,8 +1188,9 @@ public final class HTTPDemon implements serverHandler, Cloneable {
headers.put(HeaderFramework.LAST_MODIFIED, HeaderFramework.formatRFC1123(moddate));
if (nocache) {
if (httpVersion.toUpperCase().equals(HeaderFramework.HTTP_VERSION_1_1)) headers.put(HeaderFramework.CACHE_CONTROL, "no-cache");
else headers.put(HeaderFramework.PRAGMA, "no-cache");
headers.put(HeaderFramework.CACHE_CONTROL, "no-cache");
headers.put(HeaderFramework.CACHE_CONTROL, "no-store");
headers.put(HeaderFramework.PRAGMA, "no-cache");
}
if (contentType == null) contentType = "text/html; charset=UTF-8";

Loading…
Cancel
Save