r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Will
19-Feb-2009
[3997]
jQuery, good choice 8)
Robert
20-Feb-2009
[3998]
REST: Ok, I will give it a try and let you know.
Graham
21-Feb-2009
[3999x6]
If you have a web app, and you send the user to the login.rsp by 
default, but there is no index.rsp etc, then you get a 404.
Adding %login.rsp to the default block doesn't help.
I had a nasty experience just now.   I had spent the last couple 
of days writing my prototype website .. and got all the ajax stuff 
working.  I decided to reboot because the css wasn't showing properly 
in chrome but was working in FF.  Big mistake.  Windows Vista reported 
a problem booting, and started it's recovery process.  At the end 
of it, all my RSP files I had created, or edited, in the last 2 days 
were gone!  Other files ( html ) were untouched.  System restore 
failed to recover these files and using file recovery tools also 
was unable to locate them.
I guess Windows does not recognize RSP files and decides that they 
are potentially malicious ie. not a document file, and so removes 
them :(
The lesson I guess is that one should store RSP files you're working 
on in the My Documents path to prevent windows trashing them.
Oh yeah ... every directory that I had rsp files from today were 
affected.
Anton
22-Feb-2009
[4005]
That's a nasty experience.
Izkata
22-Feb-2009
[4006]
I think it's more a Windows problem than anything else.  Vista did 
that to me back during (I think) Thanksgiving with my Warcraft III 
install, and XP before that with Spore.
PeterWood
22-Feb-2009
[4007]
Perhaps a version control system would be a good place to store all 
your RSPs and all your other code and supporting files for that matter.
Henrik
22-Feb-2009
[4008]
jQuery: Have spent the past 3 days with it, and although the syntax 
is weird, it's far easier to get started with than YUI.
Kaj
22-Feb-2009
[4009]
I guess Microsoft has recognised the upcoming threat Cheyenne poses 
to them, and taken countermeasures ;-)
Graham
22-Feb-2009
[4010]
How do you add another webapp?  Just place it in the same block as 
the existing webapp [ ] block?
Dockimbel
23-Feb-2009
[4011]
domain.com [
	webapp [virtual-root "/app1" ...]
	webapp [virtual-root "/app2" ...]
 	...
]
Graham
23-Feb-2009
[4012]
so, this should be okay?

default [
	webapp [ ]
	webapp [ ]
]
Robert
23-Feb-2009
[4013x2]
Henrik, I did the same thing the last 3 days :-). Yes, weired syntax. 
It took me 30min to SEE that I have missed a # to reference an element... 
To many braces. But really simple to use than. Do we have a jQuery 
group?
Sessions: Just using session/start at the beginning of a RSP page 
doesn't start a session. You have to add at least one name/value 
pair to get back a SID. Is this intended?
Henrik
23-Feb-2009
[4015]
Robert, the private javascript group doubles as a jquery group.
Dockimbel
23-Feb-2009
[4016x2]
Graham: yes as long as you put something inside the brackets ;-).
Sessions: when you use session/start, you don't have the SID available 
immediatly, but  the SID is sent in the response. The reason is that 
RSP session management is done inside the main process and not in 
the RSP process. So, from the RSP point of vue, the SID is only available 
on the next client request. I think that this can be changed so that 
session/start generates a new SID that can be used at once in the 
RSP.
Graham
23-Feb-2009
[4018x2]
I'll try it again ... I was getting something odd where Cheyenne 
kept looking for // in the path to my webapp files
I had a problem the other day where I had what looked binary appearing 
on my RSP pages before everything else.  I had to restart Cheyenne 
for it to go away.  Wierd.
Robert
23-Feb-2009
[4020]
Sessions: Doc, I think making the change makes sense. Because otherwise 
one need to trick around with a dummy call to get the SID into the 
next (the real) RSP call.


IMO thing would become much simpler if session/start immediatly gives 
the SID / access to the SID.
Dockimbel
23-Feb-2009
[4021x2]
Graham: you should check your 'on-page-start handler, maybe you've 
forgot some code inside (you can found it in %app-init.r)
Session: sure, it might be useful, but there's no simple way to garantee 
that the new SID is not already used in the main process...The new 
SID should be random enought, but anyway, I guess you'll just have 
to cross fingers ;-)
Graham
23-Feb-2009
[4023]
this is all I have



on-application-start: does [
	;--- add here your library / modules loading
    *do %private/captcha.r
    captcha/set-fonts-path %private/fonts/
]
Robert
24-Feb-2009
[4024x2]
Sessions: I thought RSP processes are started from the main process. 
So, why not create a new SID (if necessary) in the main process and 
give it to the new RSP process?
Database: Are all database drivers included in Cheyenne or do I need 
to load them on my own? And if, how?
Dockimbel
24-Feb-2009
[4026x3]
Sessions: RSP processes are started from the main process. The SID 
*are* created in the main process that's why you can't have your 
SID at once when you call session/start, you're in the RSP process, 
not the main one.
If you meant : create a new SID each time a RSP is called in case 
the RSP script uses session/start, that could be a solution, but 
not very elegant.
Database: no driver included, you have to load them. The best place 
is in 'worker-libs config block (see ChangeLog.txt). For webapps 
specific libraries, the best place is 'on-application-start in %app-init.r.
Robert
24-Feb-2009
[4029]
Sessions: Maybe my model of how sessions are handled is wrong. I 
think/thought it works like this:
1. Main process gets request from client

2. Main process checks if for this client a SID exists, if not creates 
a unique one
3. Main process starts RSP process and provides SID
4. RSP process either uses SID or not.
Dockimbel
24-Feb-2009
[4030]
Not all RSP need to run in a session. You're wasting some resources 
there. But I agree that the SID should be available as soon as session/start 
is invoked.
Robert
24-Feb-2009
[4031x2]
Does it has so much overhead?
How about just creating the SID and do the rest as soon as session/start 
is invoked?
Graham
24-Feb-2009
[4033]
cross-post ... doc, do we have a captcha level of 0 so that a blank 
captcha is generated for testing purposes?
Dockimbel
24-Feb-2009
[4034x4]
Not sure it worthes it. Just comment your test for captcha text.
SID & session/start : I've added that to my todo list, need to think 
about that deeper before implementing.
Graham: you can set your webapp (or at domain level) in debug mode 
(using the 'debug keyword in config file). If the debug mode could 
be tested, it could allow you to enable/disable the captcha system 
(or anything else) based on the working mode (debug / in production). 
I'll add that to the todo list also.
That could be already tested right now, thought. Just use : 

debug?: to-logic find request/config 'debug

(the 'on-page-start handler could be a good place for that)
Graham
26-Feb-2009
[4038x2]
doc, what exactly is a session object?  Is it something that is server 
side only?  Or is transmitted to the client as a cookie?
Just wondering how much data I can store in the session object.
Dockimbel
26-Feb-2009
[4040]
A session is a block! of name / value pairs that is kept in Cheyenne's 
main process and exchanged with worker process. A synchronization 
system is there to avoid concurrency issues. The SID sent by cookie 
to the client is just a lookup key. When sent back to the server, 
this key allows to identify the right session object to pass to the 
RSP script in a worker process.


You are only limited by memory, but remember that the session object 
is MOLDed / LOADed and exchanged by TCP twice for a RSP request. 
So, in order to keep your RSP pages fast enough and scale well with 
a growing number of active users, keep the session block! as small 
as possible.
Graham
26-Feb-2009
[4041]
I guess it boils down to whether the slow down with large objects 
is still faster then requesting the data from the db.
Dockimbel
26-Feb-2009
[4042x2]
This is precisely where Cheyenne could benefit a lot from a multihreaded 
REBOL kernel : no more need to MOLD / LOAD session block and request 
object, no more need to exchange it through TCP with other processes...That 
would allow a big boost of RSP performances and reduce Cheyenne's 
whole memory usage.
I think that the DB will be slower, but it depends on how big are 
your "large objects".
Graham
26-Feb-2009
[4044]
I suspect only a few mbs
Dockimbel
26-Feb-2009
[4045]
Wow...that's huge! Why do you need to maintain so much data in session? 
Why not store it on disk?
Graham
26-Feb-2009
[4046]
If I want to keep all the data for a patient in a session .. and 
have mutliple  patients, I was thinking of keeping all the results, 
consults etc in the session object.