Skip to main content
1-Visitor
Aug 23, 2019 10:32 AM UTC
Question

How to remove browser cache?

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

 

Regards

Sugumar R

8 replies

22-Sapphire I
Aug 26, 2019 1:15 PM UTC

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

Translate
18-Opal
Aug 27, 2019 11:24 AM UTC

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

 

/ Constantine

Translate
1-Visitor
Aug 29, 2019 7:16 AM UTC

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

Translate
18-Opal
Aug 29, 2019 7:38 AM UTC

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

Translate