Skip to content

Commit

Permalink
Etag compression tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmalloy committed Jul 17, 2023
1 parent de44cfb commit f66e8a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/jasper/util/RestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import jasper.domain.proj.HasModified;
import jasper.service.dto.RefDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.http.CacheControl;
import org.springframework.http.HttpStatus;
Expand All @@ -19,6 +21,7 @@
import static org.apache.commons.lang3.StringUtils.reverse;

public class RestUtil {
private static final Logger logger = LoggerFactory.getLogger(RestUtil.class);

public static CacheControl ifNotModifiedCacheControl = CacheControl
.noCache()
Expand Down Expand Up @@ -71,6 +74,7 @@ private static <T extends HasModified> String getModifiedPage(Page<T> result) {
if (prefix.length() == b.length()) {
etag.set(i, "");
} else if (isNotBlank(prefix)) {
logger.trace("Etag Compression: {}, {}, prefix: {}, suffix: {}", a, b, prefix, suffix);
etag.set(i, Integer.toHexString(prefix.length()) + "/" + b.substring(prefix.length(), b.length() - suffix.length()));
}
}
Expand Down

0 comments on commit f66e8a4

Please sign in to comment.