Skip to main content
1-Visitor
August 23, 2019
Question

How to remove browser cache?

  • August 23, 2019
  • 2 replies
  • 3504 views

can anybody tell, how to automatically remove the thingworx catche from the browser using code? 

 

Regards

Sugumar R

2 replies

22-Sapphire I
August 26, 2019

Not sure if any of the available code executions would work from within a mashup using the expression widget, but you can give it a try.

Here's an article from stack overflow: https://stackoverflow.com/questions/8155064/how-to-programmatically-empty-browser-cache

18-Opal
August 27, 2019

Alternatively you can add/modify caching headers on the HTTP server level (e.g. Nginx), but... why?

 

/ Constantine

1-Visitor
August 29, 2019

Hi Constantine,

 

My requirement is to clear Thingworx catch after the user logged out from the Twx.

Currently, the Thingworx catch allow the user to log in to the composer without asking the password.

 

kindly suggest me any solution for that.

 

Regards

Sugumar R

18-Opal
August 29, 2019

Strange. If you do it the standard way through the Logout Button mashup widget, the users should not be able to reconnect after that. For that I have to ask -- how do you log your users out? Do you use Logout Button or Logout Link widgets? Do you have any custom authenticators?

 

A bit more technical explanation: It's not the cache, it's the session which keeps the user logged in. The session is on the server side, so clearing the cache is not a proper solution, because you don't kill the actual session, just remove its ID from the browser. Besides, potentially you make the some mashups load slower next time, putting additional load on the server. Still, if you really want to go that way, you probably don't need to empty the entire cache, but instead you can try to only reset the cookie called "JSESSIONID". To do this you'll need to either write you custom extension, which will do it via browser-side Javascript, or configure it on the reverse proxy side (Nginx or similar). Neither of those options is trivial to implement. Besides, the standard Logout Button widget does pretty much the same thing for you, so I would advise you to look in this direction and try to understand why it doesn't work (if you use it, of course) instead of implementing complex workarounds.

 

/ Constantine