Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Re: Run your own perlmonks!

by theorbtwo (Prior)
on Sep 30, 2003 at 08:34 UTC ( [id://295213]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Run your own perlmonks!
in thread Run your own perlmonks!

Both of those are exelecent ideas, and I'd look into implementing the first, which shouldn't be all that difficult to do, preferably as an option. (Many people are using iframeless browsers, or have iframes disabled or filtered.) It should help decently much.

The second option would be wonderful, but probably quite difficult to implement -- I don't know of any existing mechinisim to change the HTTP-level response code of everything-generated pages, but it would be quite useful indeed. (However, it may well be implementable, esp since I think (but am not certian...) that everything is rendered, then sent to the browser in one go.)

I'd look into the big question of the second, but I'm rather full of things on my PM-related hacking TODO list -- replyable patches at present. Since, IIRC, you aren't a pmdev, /msg'ing gods is the first step. Then, a week later, start looking at the code -- for the first, at the chatterbox nodelet, for the second Everything/HTML.pm, and the function Everything::HTML::displayPage, and in purticular, exporting something with which nodes can directly effect the arguments to printHeader. (If, at the same time, you create some way to allow for explicit flushes, such that the header and some of the content get output to the client before rendering is actualy complete, you could signifiantly speed up the /precived/ speed of perlmonks (but not the actual speed). The later will be quite difficult, I think, but the former significantly less so -- though my suggested implementation would add another global.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Run your own perlmonks!
by liz (Monsignor) on Sep 30, 2003 at 08:45 UTC
    ...using iframeless browsers, or have iframes disabled...

    The banner runs in an iframe (if it runs).

    ...that everything is rendered, then sent to the browser in one go...

    But you want to prevent it being rendered, as that is (presumably) the big load on the database server (please note that I have not had a look at any of the everything code: mainly to protect myself ;-) You want it to just handle the votes and then just send a 204 status without rendering or sending anything else.

    Liz

      Aye. However, in this purticular case, we could run the opcode (if any), and it could signal somehow "print exactly this content, with no header (because I've included the header), and stop processing after the opcode stage, and before the node stage".

      Thanks very much for replying to this, and please, keep doing it -- even if you don't look at the Everything code ever (and it's not really that scary), you're giving me good ideas.

      In purticular, currently, opcodes are expected to have a return value that is a bool -- handled, or not handled. We could extend this to say that if they return a scalar ref, then we print that out to the client, and stop processing.

      That doesn't give us chunking, but it does mean that some opcodes can avoid having to rerender the page, at least under some curcimstances, with signifiant savings.


      Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

        ...it's not really that scary...

        It's not that I'm afraid of the code. I'm afraid I'll be spending more time on it than I should. Time I should be spending on other things ;-)

        ...That doesn't give us chunking...

        Would you need chunking on sending back just a header? Or do you need that for the Keep-Alive? A Content-Length: 0 should be sufficient to keep the connection. should it not?

        Liz

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://295213]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-03-28 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found