House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Adding cache headers on binary stream

  << Previous Post |  RSS |  Subscribe to this Group Next >> 

Adding cache headers on binary stream

I have a variables (Pic) which contains image data read with cffile. Michael Christensen 07/19/2012 09:01 AM

07/19/2012 09:01 AM
Author: Michael Christensen Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:64071#351927 I have a variables (Pic) which contains image data read with cffile. In order to write it directly back to the browser, I use the following code: <cfheader name="Content-Type" value="image/jpeg"> <cfscript>   context = getPageContext();   context.setFlushOutput(false);   response = context.getResponse().getResponse();   out = response.getOutputStream();   response.setContentLength(arrayLen(Pic));   out.write(Pic);   out.flush();   out.close(); </cfscript> This all works great, but I'd like to add an Expires header, in order to conserve requests and bandwidth. I am not able to get this to work, so has anyone ever created something similar and been able to succesfully implement Expires headers?
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 21, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference