Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

[Custom Widget] Potential Caching Issue

DulceK
Tera Contributor

My custom widget has been keeping data from the previous page on its page . If from the custom widget page I go to another, say “Catalog”, the Catalog page and its widgets will load properly. If I select the browser’s back button and return to the page with the Custom Widget not only does the custom widget page load but the widgets from the “Catalog” page also load. As soon as I manually refresh the custom widget page it will return to normal.

While I don’t know if this is a specific caching issue I’m not sure what is causing this behavior. I would appreciate suggestions on what to try.

 

Additional Notes:

  • Unfortunately I can’t clear my browser’s cache nor can I access the “cache.do” from my ServiceNow instance.
  • gs.cachFlush() also doesn’t seem to help.
  • After pressing the browser's back button the Custom widget page’s loading indicator never stops running
2 REPLIES 2

RaghavSh
Mega Patron

can you share the client controller of your widget. is there something $window.reload or window.location.href?


Raghav
MVP 2023
LinkedIn

debendudas
Mega Sage
Mega Sage

Hi @DulceK ,

The widget behavior seems unusual, and I don’t think it’s a cache issue. Could you please share the widget script here so we can debug it further?

 

Additionally, please provide the following details for troubleshooting:

  • The initial load URL
  • The URL when you click on the catalog item
  • The URL when you click the browser back button