 |
Author |
Topic: Refresh page, not applet? (Read 1021 times) |
|
Euskadi
|
Refresh page, not applet?
« on: Sep 4th, 2004, 1:13am » |
|
I'm building a page with php/mysql driving parameters to feed into the applet. I'm using an expiration date on the page to force a refresh... is that going to force a reload of the applet also? If so, how to I force the browser to get a fresh version of the page and its parameters, but not reload the applet. (The bandwidth is going to kill me).
|
|
|
|
fjen
|
Re: Refresh page, not applet?
« Reply #1 on: Sep 5th, 2004, 12:41am » |
|
you might wanna check out this discussion: http://processing.org/discourse/yabb/board_Programs_action_disp_lay_num_1088508920.html to my understanding if your page refreshes the browser is to reload the applet as well ... as it is part of the the page not something seperate. in some/most cases (it depends on browsers) the applet might be loaded from a cache, as are images, ..., not from the server. ..but i can't think of a way to only reload the page. there are better ways to control an applet than param's. consider using a loadStrings("msqlSender.php?key=value") to get data from the database. F
|
« Last Edit: Sep 5th, 2004, 12:42am by fjen » |
|
|
|
|
Euskadi
|
Re: Refresh page, not applet?
« Reply #2 on: Sep 5th, 2004, 5:42am » |
|
I *am* using loadstrings for some info transfer... can you quantify/qualify "better"? I'm doing some loadstrings things now and they seem slow; when i drop the info in the preset page (with php) the slurp of data into the applet seems to be a LOT faster. By the way. I think SLURP should be a P5 function. -------------- The applet is definitely loaded from the cache, if I make a new version I have to close IE entirely to get the new version to load. What I'm hoping is that folks don't have to reload a 200k app every time they visit if I haven't switched to a new version. I guess if I make the expiration less often and use loadstrings() to get data, I might prevent the applet reload... hmmmm.
|
|
|
|
fjen
|
Re: Refresh page, not applet?
« Reply #3 on: Sep 5th, 2004, 11:38am » |
|
hmm - i might have gotten you wrong there. i thought you wanted to refresh params of the page while the applet is still running in it. that's a really bad idea, 'cause it is too much depending on how the browsers handle the whole param thing. meaning you can't rely on them to transport the change at all. params are more of a "load once" thing.
|
« Last Edit: Sep 5th, 2004, 11:39am by fjen » |
|
|
|
|
fry
|
Re: Refresh page, not applet?
« Reply #4 on: Sep 5th, 2004, 7:43pm » |
|
you're going to get very very different results in how browsers behave when you hit reload (across browsers, platforms, etc) so i'm almost certain that would be a nightmare. i'd suggest you use something like loadStrings or whatever to get data from the server without re-loading the page. if you're only dealing in web pages, you could have another page (other than the page the applet is on) that contains the data you need, and use loadStrings (or osmething like it) to grab a new set of data by having the applet download the page internally and parse it out. i'm guessing that the delay you're finding is the lag in hitting the web server and having things re-download.. such is the nature of this kind of method. to get things to be faster you need to maintain an open (non-http) connection to the server and spew data through that. what does slurp do differently from loadStrings or loadBytes? (other than the cooler-sounding name )
|
|
|
|
fry
|
Re: Refresh page, not applet?
« Reply #5 on: Sep 5th, 2004, 7:49pm » |
|
another ps on that.. part of the slowness comes from the thread blocking while the data is being downloaded.. so your applet will halt up until things arrive. if you do something smarter like putting the loadStrings-type code in a separate thread, you might get better results (or at least perceived results--that the applet won't halt during the download). also, loadStrings has to grab all the data, then it resizes the array and passes it back. if you want to get the data incrementally, you can use a BufferedReader or something like that on the stream to read it line-by-line as it downloads.
|
|
|
|
Euskadi
|
Re: Refresh page, not applet?
« Reply #6 on: Jan 6th, 2005, 3:12am » |
|
Is there somewhere around here to get a nice primer on creating another thread? Thanks!
|
|
|
|
|