Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Keep running script but ending it to the browser

by cowgirl (Acolyte)
on Aug 07, 2008 at 16:55 UTC ( [id://702935]=note: print w/replies, xml ) Need Help??


in reply to Re: Keep running script but ending it to the browser
in thread Keep running script but ending it to the browser

Yes that was my idea but the problem is that the script is run from the browser. It then needs to generate the image from data sent by the browser and return a HTML page with with the image tag in there. Ofcourse I could use the data sent by the browser and use it to execute the image script but I would like to minimze data sent as much as possible (it's for a mobile app). I would rather just have the image be generated to a fileand then displaying it by way of its filename and then deleting it again.

Replies are listed 'Best First'.
Re^3: Keep running script but ending it to the browser
by JavaFan (Canon) on Aug 07, 2008 at 17:11 UTC
    Why would using 2 scripts transfer more data? You will still have the client do two requests, and you still have both the HTML and the image data send to the client.
Re^3: Keep running script but ending it to the browser
by polettix (Vicar) on Aug 08, 2008 at 08:15 UTC
    This is what sessions are for. Just create a session upon the first request, storing all data needed for image generation. The first request gives back the HTML page that contains an img tag pointing to the script that generates the image; at this point you only need to provide it the session id and you're done: one data transfer, two scripts, no temporary files.

    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Io ho capito... ma tu che hai detto?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-06-20 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.