How are CFCONTENT requests handled?
I'm putting together a page on one of my sites for downloading of hi- res press images. These are JPEGs; but I want them to be downloaded rather than opened in the browser. The following code works just fine: cfheader name=Content-Disposition value=attachment; filename=press- image.jpg / cfcontent type=image/jpeg file=#ExpandPath(press-image.jpg)# / What I want to know is: if I'm serving the file in this method, does CF load the image into memory and then serve it? Or does it just point the browser to the relevant location? The reason I ask is that some of the images are up to 10MB in size, and I don't want my CF server to be hammered by someone downloading a few of these at the same time. The alternative is to zip them all up - very little size gain for JPEGs, but at least the browser will just download the file, and IIS will take the strain instead of CF... Seb Duggan Web ColdFusion Developer e: s...@sebduggan.com t: 07786 333184 w: http://sebduggan.com ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318962 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: How are CFCONTENT requests handled?
CF will be used for the duration of that request. I'd be interested in hearing a solution to this also. Adrian -Original Message- From: Seb Duggan [mailto:s...@sebduggan.com] Sent: 06 February 2009 11:49 To: cf-talk Subject: How are CFCONTENT requests handled? I'm putting together a page on one of my sites for downloading of hi- res press images. These are JPEGs; but I want them to be downloaded rather than opened in the browser. The following code works just fine: cfheader name=Content-Disposition value=attachment; filename=press- image.jpg / cfcontent type=image/jpeg file=#ExpandPath(press-image.jpg)# / What I want to know is: if I'm serving the file in this method, does CF load the image into memory and then serve it? Or does it just point the browser to the relevant location? The reason I ask is that some of the images are up to 10MB in size, and I don't want my CF server to be hammered by someone downloading a few of these at the same time. The alternative is to zip them all up - very little size gain for JPEGs, but at least the browser will just download the file, and IIS will take the strain instead of CF... Seb Duggan Web ColdFusion Developer e:s...@sebduggan.com t:07786 333184 w:http://sebduggan.com ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318963 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How are CFCONTENT requests handled?
Seb, It is most likely that CF will open the file you are delivering, however, it will probably be more in a streaming fashion, aka, it will probably not all be loaded into active memory. I just did it with a 200MB file, the memory went up about 6MB and now has dropped down 12MB. I would say it's safe. It literally streams it from disk to network and to local disk without any one application loading 200MB of data. I used CF7 and Firefox 3. nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @ http://www.azcfug.org/] On Fri, Feb 6, 2009 at 4:49 AM, Seb Duggan s...@sebduggan.com wrote: I'm putting together a page on one of my sites for downloading of hi- res press images. These are JPEGs; but I want them to be downloaded rather than opened in the browser. The following code works just fine: cfheader name=Content-Disposition value=attachment; filename=press- image.jpg / cfcontent type=image/jpeg file=#ExpandPath(press-image.jpg)# / What I want to know is: if I'm serving the file in this method, does CF load the image into memory and then serve it? Or does it just point the browser to the relevant location? The reason I ask is that some of the images are up to 10MB in size, and I don't want my CF server to be hammered by someone downloading a few of these at the same time. The alternative is to zip them all up - very little size gain for JPEGs, but at least the browser will just download the file, and IIS will take the strain instead of CF... Seb Duggan Web ColdFusion Developer e: s...@sebduggan.com t: 07786 333184 w: http://sebduggan.com ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318999 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: How are CFCONTENT requests handled?
Thanks Nathan. I'm currently trying to work out a solution using ISAPI_Rewrite to modify the headers, but can't quite get it to work yet... On 6 Feb 2009, at 20:29, Nathan Strutz wrote: Seb, It is most likely that CF will open the file you are delivering, however, it will probably be more in a streaming fashion, aka, it will probably not all be loaded into active memory. I just did it with a 200MB file, the memory went up about 6MB and now has dropped down 12MB. I would say it's safe. It literally streams it from disk to network and to local disk without any one application loading 200MB of data. I used CF7 and Firefox 3. nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @ http://www.azcfug.org/] ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319002 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How are CFCONTENT requests handled?
The issue isn't memory usage as much as it is thread usage. A server thread will be occupied for the entire duration of the download. Which means if you have large files, and 50 people are downloading, then that is 50 of your threads used for however long it takes their downloads to complete. The same is true for uploads, only much worse, since most people's upload speed is far lower than their download speed. Basically, if you plan on doing lots of large file uploads or downloads, you need to set up a dedicated file server or look at something like FTP. On Fri, Feb 6, 2009 at 3:29 PM, Nathan Strutz str...@gmail.com wrote: Seb, It is most likely that CF will open the file you are delivering, however, it will probably be more in a streaming fashion, aka, it will probably not all be loaded into active memory. I just did it with a 200MB file, the memory went up about 6MB and now has dropped down 12MB. I would say it's safe. It literally streams it from disk to network and to local disk without any one application loading 200MB of data. I used CF7 and Firefox 3. nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @ http://www.azcfug.org/] ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319003 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: How are CFCONTENT requests handled?
Or, depending on the version of CF8 and your familiarity with it, you could look at using CFTHREAD since those use a separate thread pool. On Fri, Feb 6, 2009 at 6:08 PM, Brian Kotek brian...@gmail.com wrote: The issue isn't memory usage as much as it is thread usage. A server thread will be occupied for the entire duration of the download. Which means if you have large files, and 50 people are downloading, then that is 50 of your threads used for however long it takes their downloads to complete. The same is true for uploads, only much worse, since most people's upload speed is far lower than their download speed. Basically, if you plan on doing lots of large file uploads or downloads, you need to set up a dedicated file server or look at something like FTP. On Fri, Feb 6, 2009 at 3:29 PM, Nathan Strutz str...@gmail.com wrote: Seb, It is most likely that CF will open the file you are delivering, however, it will probably be more in a streaming fashion, aka, it will probably not all be loaded into active memory. I just did it with a 200MB file, the memory went up about 6MB and now has dropped down 12MB. I would say it's safe. It literally streams it from disk to network and to local disk without any one application loading 200MB of data. I used CF7 and Firefox 3. nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @ http://www.azcfug.org/] ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319004 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4