|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Adding cache headers on binary stream
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?
|
May 21, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||