use of net.sourceforge.plantuml.PSystemError in project plantuml-server by plantuml.
the class DiagramResponse method addHeaderForCache.
private void addHeaderForCache(BlockUml blockUml) {
long today = System.currentTimeMillis();
// Add http headers to force the browser to cache the image
final int maxAge = 3600 * 24 * 5;
response.addDateHeader("Expires", today + 1000L * maxAge);
response.addDateHeader("Date", today);
response.addDateHeader("Last-Modified", blockUml.lastModified());
response.addHeader("Cache-Control", "public, max-age=" + maxAge);
// response.addHeader("Cache-Control", "max-age=864000");
response.addHeader("Etag", "\"" + blockUml.etag() + "\"");
final Diagram diagram = blockUml.getDiagram();
response.addHeader("X-PlantUML-Diagram-Description", diagram.getDescription().getDescription());
if (diagram instanceof PSystemError) {
final PSystemError error = (PSystemError) diagram;
for (ErrorUml err : error.getErrorsUml()) {
response.addHeader("X-PlantUML-Diagram-Error", err.getError());
response.addHeader("X-PlantUML-Diagram-Error-Line", "" + err.getLineLocation().getPosition());
}
}
addHeaders(response);
}
Aggregations