Open alexskr opened 2 years ago
Perhaps this is a problem on the API side since API doesn't set proper caching headers:
# curl -I 'http://data.bioontology.org/ontologies/XCO/analytics'
HTTP/1.1 200 OK
Server: nginx/1.22.0
Date: Fri, 29 Jul 2022 19:19:12 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 893
Connection: keep-alive
X-Rack-Cache: miss
Vary: Origin
X-Content-Type-Options: nosniff
Here is the call with cache control enabled:
# curl -I 'http://data.bioontology.org/ontologies/XCO'
HTTP/1.1 200 OK
Server: nginx/1.22.0
Date: Fri, 29 Jul 2022 19:13:15 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 2835
Connection: keep-alive
Vary: User-Agent, Accept, Accept-Language, Accept-Encoding, Authorization, NCBO-Slice, NCBO-Cache, Origin
Cache-Control: public, max-age=3600
Last-Modified: Fri, 29 Jul 2022 01:43:52 GMT
X-Content-Digest: 5fdeb9fa15e121232b0f1e6e2aebc7d9f82fc838
Age: 0
X-Rack-Cache: miss, store
X-Content-Type-Options: nosniff
Analytics data doesn't change frequently so it should be cached; however, UI keeps on making repeated calls to the backend to get analytics data. This adds unnecessary load on the backend.
When UI landing page is accessed we are seeing the following requests on the API side:
When /ontologies/ is repeatedly accessed: