Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfcontent and cache images

Status
Not open for further replies.

hoeflake

Programmer
Oct 16, 2001
5
NL
Since I've installed Mozilla 1.0, I can exactly see what's going on when building a website.

So, I've a script voor publishing images, it works standard:
<img src=&quot;test.com/image.cfm?action=view&file_id=XX&quot;>

and the image.cfm works like:
<CFHEADER NAME=&quot;Content-Disposition&quot; VALUE=&quot;inline; filename=&quot;&quot;#filename#&quot;&quot;&quot;>
<cfcontent type=&quot;#type#&quot; file=&quot;#session.root##session.slash#Files#session.slash##file_id#&quot;>
(type is get from a database, e.g. for .jpg's it is image/jpg)

Ok, it works almost correctly, but when I look at the page info with Mozilla, I see the these images are not chached.

I've checked other sites, some has the same problem, and other not!

Knows anyone how to solve this problem?

I've also rewritten image.cfm, so I can use:
<img src=&quot;test.com/image.cfm/action/view/file_id/imagename.jpg&quot;
but it doesn't help.

Mozilla says also he doesn't know the size of the image... I've also the cfcontent patch from Macromedia installed, this patch fixes the 2 bytes appending on each file.
 
I guessing here but I think it may be that Mozilla recognizes the link as dynamically generated content and intelligently caches it. I've noticed over the years that NS never caches a CF script while IE will often cache it even though it's dynamic and has changed.

If this is what the problem is, I see two things that would cause Mozilla to believe the content is dynamic. CF might be sending back header info indicating the content should not be cached or it may be the presence of a &quot;?&quot; tells it that the content is dynamic.

If it's header info, I don't know of a way to tell CF not to send it. If it's the &quot;?&quot;, you could try sending your paramters with the &quot;/&quot; syntax like this.


I've never used this but I know it's sometimes used to keep search engines from excluding dynamic content.

Good luck,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top