You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$subject and hits the backend rather taking the caches response. The issue lies with the age calculation
Steps to reproduce:
importballerina/http;
importballerina/log;
http:ClientcachingEP=checkpanicnew ("http://localhost:8080",
{cache: {enabled: true, isShared:true}});
service/cacheonnew http:Listener(9090) {
resourcefunction get .(http:Callercaller, http:Requestreq) {
http:Response|errorresponse=cachingEP->forward("/hello", req);
if (responseishttp:Response) {
var result =caller->respond(response);
if (resultiserror) {
log:printError("Failed to respond to the caller", result);
}
} else {
http:Responseres=new;
res.statusCode=500;
res.setPayload(response.message());
var result =caller->respond(res);
if (resultiserror) {
log:printError("Failed to respond to the caller", result);
}
}
}
}
service/helloonnew http:Listener(8080) {
resourcefunction 'default .(http:Callercaller, http:Requestreq) {
json payload = {"message":"Hello, World!"};
http:Responseres=new;
http:ResponseCacheControlresCC=new;
resCC.maxAge=15;
resCC.mustRevalidate=true;
resCC.isPrivate=false;
res.cacheControl=resCC;
res.setETag(payload);
res.setLastModified();
res.setPayload(payload);
var result =caller->respond(res);
if (resultiserror) {
log:printError("Failed to respond to the caller", result);
}
}
}
Invocation 1 : Hit backend : 200 OK response
Invocation 2 : Within max age : Take from cache
Invocation 3 : After max age timeout : Hit backend : 304 Not modified response
Invocation 4 : Within 2nd max age : Hit backend : 304 Not modified response // this is problematic
Affected Versions:
SL beta 4
The text was updated successfully, but these errors were encountered:
Description:
Steps to reproduce:
Affected Versions:
SL beta 4
The text was updated successfully, but these errors were encountered: