Disable spray caching

Skip to first unread message


Aug 4, 2016, 6:54:06 AM8/4/16
to spray.io User List
Hi all,

We have a simple routing structure built on spray. These routes all internally lead to code that calls external APIs using code built on spray http client.

We're seeing weird behaviour in that repeated requested are dramatically faster than the initial ones (3 seconds down to 200ms). Our upstream API is not caching which leads up to believe that our routes are caching somehow or the spray client code is doing this.

We haven't explicitly setup any caching code.

Has anyone experienced this behaviour before that could point us in the right direction?



Age Mooij

Aug 4, 2016, 9:20:22 AM8/4/16
to spray...@googlegroups.com
There is definitely no request/response caching code present in Spray client.

If you are seeing this initial delay only once per client target host, then I guess you are seeing the effect of connection reuse.

Spray client keeps connections open to target hosts because setting up an http connection (which often also involves the TLS handshake process) can be time-consuming. Subsequent requests to the same host:port will reuse those connections.

Hope this helps

You received this message because you are subscribed to the Google Groups "spray.io User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
Visit this group at https://groups.google.com/group/spray-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/a0d70a29-e635-4eb7-8e7a-bba0f394fe15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
0 new messages