|
<< Click to Display Table of Contents >> Navigation: Forum > Problem with cache and 404 error |
03-25-2024, 01:54 AM:
Hi,
I have an IW application which is sometimes called with a parameter in the URL.
https://mycompany.com/$/start/myparam
The first time I call this it works fine. In the ServerController the BeforeDispatch event is called, then AfterDispatch, then UserSessionBaseCreate,
then ServerControllerBaseNewSession, then the main form is displayed.
But, the second time I call it only the ServerController BeforeDispatch and AfterDispatch events are fired. Nothing else. Then the browser displays a 404 error. If I open a second tab in the browser and clear the cache I can return to the first tab, refresh it and everything is normal.
In the ServerControllerBeforeDispatch event, I am setting aReply.AllowCaching to false. I've also experimented with including the following lines:
// aReply.Headers.Add('Cache-control: no-cache');
// aReply.Headers.Add('Cache-control: no-store');
// aReply.Headers.Add('Pragma: no-cache');
// aReply.Headers.Add('Expires: 0');
None of them make any difference. Subsequent calls to https://mycompany.com/$/start/myparam result in a 404 error. This lasts until either the browser cache is cleared or the IW server is restarted.
Any ideas?
Thanks,
Tim
04-03-2024, 09:06 AM:
I think you are using path info as a parameter.
If you need to pass a parameter, use a parameter not path info.
URL parameters (or query fields) are passed as:
https://mycompany.com/$/start/?myparam
Parameters passed that way - as true parameters - are not cached.