Last active
June 29, 2018 17:06
-
-
Save pubudu91/62cc3a8d21b2dc8c6c5cfd1925ffa47a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/http; | |
endpoint http:Client cachingEP { | |
url: "https://jigsaw.w3.org/", | |
cache: { | |
isShared: true | |
} | |
}; | |
@http:ServiceConfig { | |
basePath: "/cache" | |
} | |
service<http:Service> cachingService bind { port: 9090 } { | |
@http:ResourceConfig { | |
path: "/" | |
} | |
cacheableResource(endpoint caller, http:Request req) { | |
http:Response response = check cachingEP->get("/HTTP/cc.html"); | |
_ = caller->respond(response); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment