FHIR Chat · Time to execute POST than GET · implementers

Stream: implementers

Topic: Time to execute POST than GET


view this post on Zulip DevGeek (Jul 30 2020 at 13:48):

Hi,

For example if I POST a new resource instance Patient, Questionnaire etc.. It takes around 10-15 seconds to be able to GET it in other requests by the REST API .. How can I improve that please ? I have a page that creates and reloads and not able to get the item inserted.

view this post on Zulip Marian Hummel (Jul 30 2020 at 14:49):

Hey,
we made the same observation and found out that we have to turn off caching.

view this post on Zulip DevGeek (Jul 30 2020 at 14:56):

@Marian Hummel Thank you I'm new to HAPI, so this caching needs to be configured in code side ?

view this post on Zulip David Pyke (Jul 30 2020 at 14:56):

Best to ask this in #hapi

view this post on Zulip Marian Hummel (Jul 30 2020 at 15:33):

@DevGeek i think so, we used something like this

client.search<Bundle>()
.forResource(Practitioner::class.java)
.where(Practitioner.XXX.exactly().code(XXX))
.returnBundle(Bundle::class.java)
.cacheControl(CacheControlDirective().setNoCache(true))
.execute()

view this post on Zulip DevGeek (Jul 31 2020 at 07:44):

Hi Where can I find this code ?

client.search<Bundle>()
.forResource(Practitioner::class.java)
.where(Practitioner.XXX.exactly().code(XXX))
.returnBundle(Bundle::class.java)
.cacheControl(CacheControlDirective().setNoCache(true))
.execute()

and if I modify it , will the the speed of requests be enhanced ?

view this post on Zulip Marian Hummel (Jul 31 2020 at 09:38):

@DevGeek
for client operations have a look here: https://smilecdr.com/hapi-fhir/docs/client/generic_client.html
Cache settings can be found here
https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/rest/api/CacheControlDirective.html

view this post on Zulip Joel Schneider (Aug 05 2020 at 21:08):

For the hapi-fhir JPA server, there's also a server-side configuration option to disable caching.
https://hapifhir.io/hapi-fhir/docs/server_jpa/configuration.html#search-result-caching


Last updated: Apr 12 2022 at 19:14 UTC