Datajs cache and http 403 forbiden

May 23, 2012 at 7:35 AM
Edited May 23, 2012 at 7:39 AM

Hi all,

I am having trouble with caching (assuming that it has something to do with cache)

I am using phonegap and datajs. first time accessing the page is alright it goes smoothly. But when it returns to the page that was accessed b4 it will have a 403 forbiden message. Due to that, we tried to clear data manually on android, then access the application again then it works. But again on second time accessing the page trows us a 403 forbiden error.

For HTC it will not refresh to the updated list. But these codes that I am using, it works perfectly on iOs.

I am not sure why this is happening but normally I would get 403 only when the authentication token is invalid. However, in debuging the token has a value and the time the token is fetched till it is passed back is just a short time. therefore, it should be the token's expired.

There is also another problem. When there is a post request to update data, it will also return a 403 (HTC and Samsung). but in iOs it works perfectly.

Does datajs stores cache automatically because, we did not save any cache in the application. Is there anyway to clear all cache without even saving it in the first place? Has this problem go something to do with datajs or phonegap or android?

Any advice and input is much appreciated... thank you.


May 30, 2012 at 7:57 PM

Hi Amanda,

   By caching do you mean that you are using datajs data cache component or the browser's cache?   I assume that the latter... datajs doesn't fiddle with the browser cache at all (I'm pretty sure you cannot change stuff on the browsers cache using javascript anyway... maybe clear it).   

   Also, by returning to the page you mean that you navigate to a different page and then back to your webapp? Can you explain a little bit more the steps you take to get to the invalid behavior?    Based on what you describe above, seems to be an Android specific behavior.. have you tried to turn off caching in your webapp using html meta tags...   Have you also verified in the request trace that the correct authorization headers are being sent?  I would start by looking a a trace from iOS and compare it against a trace from Android and see what are the differences.


Alex Trigo.