RE: netWindow - PHP data transfer model
"Christian Boulanger" <[email protected]>
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <000c01c360b1$3e51c510$0200a8c0@Laptop> |
> You will want to make sure that your server sends appropriate cache
headers so that no
> roundtrip is needed (or just a If-Modified-Since check). Note that this
means that
> you can *not* be setting cookies in your data url handler, because cookies
kill caching.
> Whether you use Last-Modified, Expires, or Cache-Control depends on the
nature of your requests.
Does this basically rule out PHP Session management? (Which sets the cookie
"phpsessionid"). I do not know if I fully understand you. Is the cache
destroyed even if a Sub-Window (i.e. a window created by NetWindows) is
loaded with data? Users aren't supposed to press the refresh button, if they
do, it is not the fault of the application if the data is lost, no? The
"Last-Modified, Expires, or Cache-Control"- header-stuff is greek to me, if
it is important, I would be happy about a reference on that (maybe
off-line).
> - How large is the data? Is it more than a 100Kbytes?
> You'll want to make sure your server accepts a gzip transfer encoding.
No, the data is not that large, but it would contain two-dimensional arrays
(array[x][y]) which are difficult to collaps..
> You may want to also use "output caching"
> techniques on the server.
Yes, I am using this technique already - request that have made before are
served with the already computed content unless a flag is set.
> - Will a single page be making multiple data requests? How many? In
> series or parallel?
I think serial requests are sufficient. I want to make few and large
data-requests, the result of which is shown in windows, and many short
("just a question...")- requests, for example, "is this user registered?",
"please update record no. X with data y".., the response to which should not
show in any window.
> - What browser makes and versions are you targeting?
The same that netWindows runs on.
> - What will the data sent back be? A text string you parse? A
> javascript expression? html?
This should depend on the type of request. If I make a LoadURL-Request, the
data is obviously going to be HTML/Javascript. If it is a data-request, I
want the answer to be in a format that Javascript can convert instantly to
variables. And I am still uncertain how this should be done. Send Javascript
to be evaluated? (That is my current solution)
Or find some mid-range format which could be the same on client and server
side (for example, Python-type dictionaries "{'key1':'value1', 'key2':
{'key2.1':'value2.1', 'key2.2':'value2.2'}, 'key3':'value3'}". I don't know.
Javascript could send PHP-Arrays to be eval'd
("array('key1'=>'value1',...."), but I do not like this for aestetic
reasons. I might have found a array to string / string to array solution at
http://www.flashforum.de/archiv/topic/62187-1.html , the logic of which I
can convert to PHP.
> __env__.addToPageQueue(url, dest_div_node, false, notifyobj,
> notifymeth)
>
> dest_div_node is a DOM node whose content you want set to what is
> fetched from the url. notifyobj[notifymeth] will be called when it is
ready.
> you can get the content back by doing dest_div_node.innerHTML
> if it is html content.
The part about the callback function is good to know! Where are the access
points of the different widgets? What is the difference between "domnode"
and "contentnode"?
So should I use "_env__.addToPageQueue" always when making a request? If I
do not want the response to be shown in any window, what should the
"dest_div_node"be? How do I create a non-visible dest_div_node? Simple
create a DOMnode? Sorry for all of these questions, I wish I could look it
up myself...
C.
_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org