Need to do a browser "empty cache", is it possible?

Bringing your stacks to the web

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
djkesler
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 58
Joined: Tue Jun 01, 2010 10:37 pm

Need to do a browser "empty cache", is it possible?

Post by djkesler » Fri Jul 01, 2022 3:28 pm

I have been working converting a program to work as a Web app.

Working my way through the issues, I'm very close to having it done. But one problem that I can't seem to find a way around is putting new text in the tooltip of a field. The contents of the field, I can update. The associated image of the field I can update. But setting updated text in the tooltip requires an "empty cache" before it will actually replace the text.

I know that each browser has a way to do this(in Safari, option, command, E), but is there a way programmatically to force the cache to be flushed?

I don't really know anything about browsers, but I would assume that there is some API for each to do such a task. Am I wrong?

This program will have a very limit audience, a dozen at most. So, I can require a specific browser on both platforms if there is some sort of solution.

Thanks for any suggestion.
David Kesler

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Need to do a browser "empty cache", is it possible?

Post by jacque » Sat Jul 02, 2022 5:29 pm

I'm not sure about web apps, but I had a similar problem on desktop. LC seems to retain the tooltip unless you first set it to empty and then set the new one.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

djkesler
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 58
Joined: Tue Jun 01, 2010 10:37 pm

Re: Need to do a browser "empty cache", is it possible?

Post by djkesler » Mon Jul 04, 2022 5:33 pm

Thanks for the suggestion, but no happiness 😔.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Need to do a browser "empty cache", is it possible?

Post by FourthWorld » Mon Jul 04, 2022 5:51 pm

If the other changes your script is making are evident as expected, I'd guess this isn't a cache issue.

As Jacque noted, there are some oddities with LC's tooltips. There may be a workaround for using tooltips, but until it's found you may also consider having your own popup in a field.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 161
Joined: Tue Feb 23, 2010 10:53 pm

Re: Need to do a browser "empty cache", is it possible?

Post by bobcole » Sun Jul 10, 2022 5:35 am

Changing the tooltip seems to work for me with web deployment.
I created a stack with one button. When the button is clicked, the tooltip is set to a random string of characters (see the script).
I first tried to set the tooltip to a 1 to 4 digit random number but that didn't work.
Apparently, only character strings are valid tooltips for web deployment at the moment.
My 10-0-0-dp-4 stack is attached. I tested it in 10-0-0-dp-3 and it worked, too.
Bob
Tooltip Test.livecode.zip
(1.54 KiB) Downloaded 584 times

djkesler
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 58
Joined: Tue Jun 01, 2010 10:37 pm

Re: Need to do a browser "empty cache", is it possible?

Post by djkesler » Tue Jul 30, 2024 1:39 pm

I know it was quite awhile ago for this question, but I finally found an ANSWER!!!

I inserted the following line into the "opencard" function:

set the httpHeaders to "Cache-Control: max-age=0"

This solved all the issues that I was having when making multiple changes to a particular field/image/widget in the web deployment.

There seemed to be no side effects, which is really great!

Hope this works for others seeing this problem.

David Kesler

makeshyft
Posts: 221
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re:Need to do a browser "empty cache", is it possible?

Post by makeshyft » Sat Aug 10, 2024 8:25 pm

Thanks David for posting your solution.
This would solve a big problem with the widget.
I will come back to confirm the lack of sideeffects.
Also will come back with a routine that clears the browser cache of existing browsers (but must clear all browsers current URL))
(If my idea works)
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Post Reply