World: r3wp
[!Cheyenne] Discussions about the Cheyenne Web Server
older newer | first last |
onetom 6-May-2011 [10271] | so, if there is no bind-extern RSP [ .r ] then where are the .r files get executed? within the main cheyenne process? |
Dockimbel 6-May-2011 [10272x3] | onetom: They should be just served as a static resource if the 'bind-extern directive is not used. |
Kaj: I'm looking into that issue right now. | |
Kaj: I've pushed a fix in r137 for fast-rebol-cgi. It was wrongly defined as a Globals section keyword instead of a Host section one. | |
Kaj 6-May-2011 [10275x2] | Ah, I was wondering about that |
So I have to define it for every applicable host? | |
Dockimbel 6-May-2011 [10277] | Yep. |
Kaj 6-May-2011 [10278x2] | Thanks, I'll try |
By the way, I still want to get rid of the loading of the REBOL CGI script on each request, even though I've minimised its size. It's a fallback script that now executes in the not-found handler. If I would change it from a fast-rebol-cgi script to an .r script, and put it in an ALIAS handler, would that preempt the loading of the script one each request? I'm not using the RSP interface, so the loading of that would be extra overhead. Would it still be faster than loading the small fast-rebol-cgi script? | |
Dockimbel 6-May-2011 [10280] | Hard question for past midnight, I think you've lost me after the first sentence. :-) |
Kaj 6-May-2011 [10281] | Oh, I thought I was the amateur. :-) Maybe a night sleep will enable you to answer it? |
Dockimbel 6-May-2011 [10282] | What are you calling the "not-found handler"? |
Kaj 6-May-2011 [10283] | 404 status |
Dockimbel 6-May-2011 [10284] | Ok. |
Kaj 6-May-2011 [10285x2] | Same way QM hooks into Cheyenne |
I mean, RSP templates are cached, right? So are the new .r files cached, too, instead of loaded on each request like CGI scripts? | |
Dockimbel 6-May-2011 [10287x2] | RSP templates: yes, .r files: I'm not sure, checking the code... |
.r: right, they are cached too when they are evaluated by the RSP handler. | |
Kaj 6-May-2011 [10289] | Cool, and refreshed when modified? |
Dockimbel 6-May-2011 [10290x2] | Sure. |
If I would change it from a fast-rebol-cgi script to an .r script I understand you want to use the RSP handler instead of the CGI handler? | |
Kaj 6-May-2011 [10292x2] | So do you think preparing the RSP interface for each request would still be faster than reading a small rebol-fast-cgi file every request? |
Yes, if that would be faster | |
Dockimbel 6-May-2011 [10294] | Hard to say, the RSP "preparation" overhead is much bigger than for CGI, but OTOH, the CGI script is not cached in memory... |
Kaj 6-May-2011 [10295] | I thought so. I'd have to do measurements to be sure |
Dockimbel 6-May-2011 [10296] | At least, not explicitly cached, but it will probably live in the system memory cache for disk files, so hard to say. |
Kaj 6-May-2011 [10297x3] | Thanks, that clears it up as far as we can get now |
It works. I'm now running the binary version of Cheyenne instead of the source version | |
That should mean I will now be able to use the 0MQ binding | |
onetom 7-May-2011 [10300x5] | hmm... i thought i can put my shared library code above the webapp root, but it seem to fail without any errors. what exactly is the purpose of the overwritten 'do function in the RSP handler? i don't quite get that depth/1 and arg/3 stuff |
i was moving a plain .r script which was aliased in a vhost context under a webapp and it started to fail because the 'do didn't seem to work properly | |
REBOL [] do %../lib/obj.r probe to-object [a: 1] | |
obj.r defines to-object but i get a ** Script Error : to-object has no value | |
i moved the library stuff into on-application-start, but still it wasted me a lot of time to realize that the 'do is overwritten in RSP and works specially (as in, it does not work) in webapp context | |
Dockimbel 7-May-2011 [10305x2] | what exactly is the purpose of the overwritten 'do function in the RSP handler? Bind the loaded code to a special per-webapp context. |
A webapp execution context is isolated as much as possible from the rest of the vhost. | |
onetom 7-May-2011 [10307x2] | set 'do func [[catch] value /args arg /next /global /local depth][ ... if arg: find apps request/config/root-dir [ |
looks like u r using a parameter as a local variable | |
Dockimbel 7-May-2011 [10309] | I thought I've added a note about DO having special effect in RSP scripts, but I can't find any mention in the wiki. |
onetom 7-May-2011 [10310] | i think there was some conversation about the overwriting 'do on altme, but i couldn't find it in the docs either... maybe in the changelog?.. |
Dockimbel 7-May-2011 [10311] | The 'arg parameter is processed before that line by: if args [return *do/args value arg] |
onetom 7-May-2011 [10312] | sure, and then u overwrite it |
Dockimbel 7-May-2011 [10313] | ChangeLog: yes, you should find it mentioned there. I need to add a proper entry in the wiki about that anyway. |
Kaj 7-May-2011 [10314] | Tamas, parameters ARE local variables |
onetom 7-May-2011 [10315x3] | Kaj: im just saying, it's a bit misleading to use an input parameter later as a temp variable in an other meaning |
do/global works, btw, however a plain 'do fails very interestingly and reproducably | |
if i edit the file above while cheyenne is running, it starts to work; to-object is found | |
Dockimbel 7-May-2011 [10318] | Right, words definitions that needs to be loaded in global context have to be loaded using 'do/global. |
onetom 7-May-2011 [10319] | these are webapp specific functions though, so i would have appreciated if they worked ;) |
Dockimbel 7-May-2011 [10320] | Where are you loading them? 'on-application-start? |
older newer | first last |