NetTalk Central

Author Topic: NetWebServiceMethod - caching  (Read 2840 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
NetWebServiceMethod - caching
« on: November 07, 2017, 01:42:25 AM »
Hi,

I've been experiencing "problems" where I use the WinHttp OLE control in a Clarion program to call a webservice method done in NetTalk. When the same HTTP request is made repeatedly with exactly the same values, the actual request never arrives at the service - but it returns a previous response value. So it looks like the client control caches the request and response, probably to save time.

I can't do much about the WinHttp OLE control in my Clarion app - there is no option to cache or not to cache. But it seems like the magic comes from the service. There seems to be two ways to instruct the client not to cache. If anyone can respond please, I want to confirm that my thinking is correct please.

The first is to set this in the WebServer procedure's "Override Default Server Settings", which instructs all connections not to cache responses.

    s_web.HeaderDetails.CacheControl = net:DontCache

The second is per NetWebServerWorker procedure, to set this value in the "ServiceMethod" routine.

    p_web.ForceNoCache = 1

Is this the correct way to disable caching on the client?
Thys