Page 1 of 1
What to put in http header to avoid caching ?
Posted: Fri Apr 20, 2007 12:07 pm
by pkmittal
Hello,
When I use put command for calling http request then sometime it does not seems to return the new results, ( It could be either the proxy server at client side is returning the results from the cache or the server at out side is caching those requests )
Any idea about the script that can set http header to "No Cache" so that It always get the new results from the server ?
Is there any way to set the global property so that I do not need to set http headers in all places whereever I am forming http requests ?
Please let me know if you have some insights.
Thanks
Best Regards
Pradeep
Posted: Fri Apr 20, 2007 7:12 pm
by Mark
Hi Pradeep,
To prevent client-side caching, the server would include
Cache-Control: no-cache
in the HTTP headers. Server-side caching really is a server-side matter and there is little or nothing you can to against it, unless you are the admin of the server.
Do you have any additional information regarding the problem?
Best,
Mark
Proxy server on client side seems to cache the results
Posted: Sat Apr 21, 2007 6:24 am
by pkmittal
Hello Mark,
I am asking clients to download the software which looks like the link below.
http:///www.xyz.com/player.exe
After updating the player.exe on the server, When I ask client to click on the above type of link and ask them to run the software then it is not taking the new exe always.
So It seems that proxy server on client side is not getting the latest exe from our server. Perhaps the proxy on client side is caching the exe on their firewall. Is there any way to avoid such problems ?
Another problem is how to make sure that whenever rev client sends http request, then proxy on clients always get the response from the server for each query. One way to solve the proble is appending the random parameters in each url, but for this things, the code has to be modified in many places.
Is there a way so that one can set the global propery of html headers in rev script to avoid a caching problems?
The response results is plain text generaated by php. I am not generating html headers in the response. Can I still avoid caching problems?
Please let me know if it is not clear enough.
Thanks
Best Regards
Pradeep
Re: Proxy server on client side seems to cache the results
Posted: Thu May 03, 2007 12:42 am
by Mark Smith
Pradeep, I don't believe that there is a way to permanently set the httpHeaders as you'd like, but you could write a simple wrapper function:
Code: Select all
function getURL pURL
set the httpHeaders to "Cache-control : no-cache"
return URL pURL
end getURL
so instead of "put URL someUrl into someVariable",
you'd have "put getURL(someURL) into someVariable".
Secondly, though you can't do much with it, you could at least see what the server is doing by checking what is returned by libURLLastRHHeaders() after each call to the server.
Best,
Mark Smith