주 콘텐츠로 건너뛰기
26

An F5 iRule to set cache-control headers Collecting Feedback

This isn't a suggestion, except maybe that you might consider making a knowledgebase article for anyone who might find it useful:

I have created the following iRule for the F5 BIG-IP platform; this iRule can be attached to a pool that services Deskpro and will set the cache-control headers for the /assets/* directory, but leave the rest alone. The code is below, but I'm also attaching it as a text file.

-----------

# this F5 BIG-IP iRule will set the cache-control header for the attached pool, for static Deskpro assets (/assets/*)
# edit the max-age value to the cache timer, 84600 is one week

# grab the URI so we can use it when the response comes back
when HTTP_REQUEST {
set HTTP_URI [HTTP::uri]
}

when HTTP_RESPONSE {
# if the URI is for a static asset (/assets/*)
if { $HTTP_URI starts_with "/assets/" } {
# then set a cache-control header
HTTP::header insert cache-control "max-age=86400"
} }

댓글 등록

댓글을 작성하려면 로그인하거나 등록하셔야 합니다.

비밀번호를 잊으셨나요?

첨부파일