简体   繁体   中英

Servlet Filter is not being hit intermittently

I am facing a very strange issue.

Issue is we have a web application (war)which is built using angular 4 and it also has a "Servlet filter" which scans each and every request for a token and if that token is not available servlet filter will navigate to third party login page. If token is available , it simply loads index.html and other data. Token and some other params will be available as session cookies to current web app.

I have accessed the app URL and logs in to app and performs some actions in app and closes the browser window without logging out and I tried to open the same URL again , Servlet filter is not getting called.

If I refresh the browser window, filter is getting called.

If I clear the browser cache Servlet filter is getting called . I have observed same behavior in chrome and firefox. I did check localhost access log, I don't see my request there. Can anyone have any ideas on what is the issue and how to fix this issue ?

Reason is Google Chrome is caching so request is not all going to server. But when I refresh chrome is sending the request to Server. When I disable cache , everything is working fine. A good lesson about caching.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM