@vlaaad Any idea why a :web-view
would seem to cache a rendered page? In my observable view, if it gets a <http://java.net|java.net>.URL
, it produces a :web-view
for that URL. When I give it the URL of my localhost server, it doesn't always seem to make the request -- sometimes it renders a blank page, sometimes I have to run the eval twice to get the updated page.
Hmm, cljfx skips URL reload if new value is the same as old one, maybe that's the behavior you are seeing?
If you tap url to the same external page twice in a row it will only load it once
Even with a cache buster to make the url unique it still seems to only load the page every other time.
It makes using the internal browser in Reveal really hard. I'm trying to use it for viewing the web app that I'm developing, so it needs to fetch the url every time.
I think this cache buster has to be in the URL itself that is tapped for it to work. Cljfx assumes it works with pure functions
Although I would expect for observable fn to be called on every change... I'll have a look when I'll be at a computer
I'm evaluating (<http://java.net|java.net>.URL. (str "<http://localhost:8888/?i=>" (rand-int 10000)))
via tap>
and the observable view's function returns a (new?) :web-view
hash map each time.
The REPL shows the URL is different every time. Debugging in the web app shows it is only being invoked on every other URL.
Can't reproduce it with simple http server — the endpoint gets triggered every time for me, and web view is refreshed every time as well
tried with python -m SimpleHTTPServer
Interesting. I wonder if it's somehow because the http server I'm running is inside the REPL/JVM that is also running Reveal and therefore invoking the web-view?
I see the eval of the <http://java.net|java.net>.URL
and it shows the unique URL each time. I'll go through the code in more detail and see if I can figure out where the ball is being dropped in the chain.
If I add a cache buster to the URL (`(str url "?" (rand-int 10000))`) then it seems to make every other request (consistently).
(I wonder if it only does this for http:
links? It seems to request https:
links every time...)
I use Reveal with Java 11(.0.8) without issues