setDateAndCacheHeaders() — netty Function Reference
Architecture documentation for the setDateAndCacheHeaders() function in Http2StaticFileServerHandler.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD ecbbd3fe_4494_4d38_50f0_f80f99f7efbf["setDateAndCacheHeaders()"] 0106d702_a5aa_70a0_2d44_3e8c79971862["Http2StaticFileServerHandler"] ecbbd3fe_4494_4d38_50f0_f80f99f7efbf -->|defined in| 0106d702_a5aa_70a0_2d44_3e8c79971862 f3d3a002_604b_1387_a2bd_93edd96b6d76["channelRead()"] f3d3a002_604b_1387_a2bd_93edd96b6d76 -->|calls| ecbbd3fe_4494_4d38_50f0_f80f99f7efbf style ecbbd3fe_4494_4d38_50f0_f80f99f7efbf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
example/src/main/java/io/netty/example/http2/file/Http2StaticFileServerHandler.java lines 355–368
private static void setDateAndCacheHeaders(Http2Headers headers, File fileToCache) {
SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
dateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP_DATE_GMT_TIMEZONE));
// Date header
Calendar time = new GregorianCalendar();
headers.set(HttpHeaderNames.DATE, dateFormatter.format(time.getTime()));
// Add cache headers
time.add(Calendar.SECOND, HTTP_CACHE_SECONDS);
headers.set(HttpHeaderNames.EXPIRES, dateFormatter.format(time.getTime()));
headers.set(HttpHeaderNames.CACHE_CONTROL, "private, max-age=" + HTTP_CACHE_SECONDS);
headers.set(HttpHeaderNames.LAST_MODIFIED, dateFormatter.format(new Date(fileToCache.lastModified())));
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does setDateAndCacheHeaders() do?
setDateAndCacheHeaders() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/http2/file/Http2StaticFileServerHandler.java.
Where is setDateAndCacheHeaders() defined?
setDateAndCacheHeaders() is defined in example/src/main/java/io/netty/example/http2/file/Http2StaticFileServerHandler.java at line 355.
What calls setDateAndCacheHeaders()?
setDateAndCacheHeaders() is called by 1 function(s): channelRead.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free