Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: implement client-side caching based on ETags to reduce network traffic and potentially reduce load on ZGW API's backend #370

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ COPY --chown=tomcat lib/webapp/* /usr/local/tomcat/webapps/ROOT/WEB-INF/lib/
# # Compile custom class
# FROM eclipse-temurin:17-jdk-jammy AS custom-code-builder

# # Copy dependencies
# COPY --from=ff-base /usr/local/tomcat/lib/ /usr/local/tomcat/lib/
# COPY --from=ff-base /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/ROOT
# Compile custom class
FROM eclipse-temurin:17-jdk-jammy AS custom-code-builder

# # Copy custom class
# COPY src/main/java /tmp/java
# RUN mkdir /tmp/classes && \
# javac \
# /tmp/java/org/frankframework/parameters/Parameter.java \
# -classpath "/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/*:/usr/local/tomcat/lib/*" \
# -verbose -d /tmp/classes
# Copy dependencies
COPY --from=ff-base /usr/local/tomcat/lib/ /usr/local/tomcat/lib/
COPY --from=ff-base /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/ROOT

# Copy custom class
COPY src/main/java /tmp/java
RUN mkdir /tmp/classes && \
javac \
/tmp/java/org/frankframework/http/HttpSenderCached.java \
/tmp/java/org/frankframework/http/HttpSenderBaseCached.java \
-classpath "/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/*:/usr/local/tomcat/lib/*" \
-verbose -d /tmp/classes

# FROM ff-base
FROM ff-base

# Copy custom entrypoint script with added options
COPY --chown=tomcat docker/entrypoint.sh /scripts/entrypoint.sh
Expand All @@ -44,7 +48,7 @@ COPY --chown=tomcat src/main/resources/ /opt/frank/resources/
COPY --chown=tomcat src/test/testtool/ /opt/frank/testtool/

# # Copy compiled custom class
# COPY --from=custom-code-builder --chown=tomcat /tmp/classes/ /usr/local/tomcat/webapps/ROOT/WEB-INF/classes
COPY --from=custom-code-builder --chown=tomcat /tmp/classes/ /usr/local/tomcat/webapps/ROOT/WEB-INF/classes

# Check if Frank! is still healthy
HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=60 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
name="GetRolTypenByUrlSender"
getInputFromSessionKey="originalMessage"
>
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="GetRolTypenByUrlHttpSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<SenderPipe name="GetZaakDocumentByUrl"
getInputFromFixedValue="&lt;dummy/&gt;">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="GetZaakDocumentByUrlSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<SenderPipe name="GetZgwZaakTypeByUrlSender"
getInputFromFixedValue="&lt;dummy/&gt;">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="GetZgwZaakTypeByUrlHttpSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<SenderPipe name="GetZgwInformatieObjectTypeByUrl"
getInputFromFixedValue="&lt;dummy/&gt;">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="GetZgwInformatieObjectTypeByUrlSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<SenderPipe name="GetZgwStatusTypeByUrlSender"
getInputFromFixedValue="&lt;dummy/&gt;">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="GetZgwStatusTypeByUrlLocalSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<SenderPipe name="GetZgwZaakByUrl"
getInputFromFixedValue="&lt;dummy/&gt;">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="GetZgwZaakByUrlSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</PutInSessionPipe>

<SenderPipe name="getZaakTypeByUrl" storeResultInSessionKey="zaakTypeJson">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="getZaakTypeByUrl"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand All @@ -59,7 +59,7 @@
<Param name="Authorization" xpathExpression="concat('Bearer ', $token)" >
<Param name="token" sessionKey="token" />
</Param>
</HttpSender>
</Sender>
<Forward name="exception" path="ErrorJsonToXml_2" />
</SenderPipe>
<JsonPipe name="ErrorJsonToXml_2">
Expand All @@ -82,7 +82,7 @@
</XsltPipe>

<SenderPipe name="getRollenByUrl" getInputFromFixedValue="&lt;dummy/&gt;" storeResultInSessionKey="rollenJson">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="getRollenByUrl"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand All @@ -93,7 +93,7 @@
<Param name="Authorization" xpathExpression="concat('Bearer ', $token)" >
<Param name="token" sessionKey="token" />
</Param>
</HttpSender>
</Sender>
<Forward name="exception" path="ErrorJsonToXml_3" />
</SenderPipe>
<JsonPipe name="ErrorJsonToXml_3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<SenderPipe
name="GetZgwRolTypeByUrlSender"
getInputFromFixedValue="&lt;dummy/&gt;">
<HttpSender
<Sender className="org.frankframework.http.HttpSenderCached"
name="GetZgwRolTypeByUrlHttpSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
Expand Down
Loading
Loading