Answered
Can I cache a CFHTTP process within an include?
Hi,
Can someone please help me with caching advice?
I want to access a snippet of code (from my own server) to include on my CF scripts. Specifically, it is my website header which contains some SSIs (#include). (My site is mostly static with a couple of CF scripts only.)
Sample header code:
I thought to workaround this by creating a CF include that used CFHTTP to get the fully parsed header then include it into the CF pages. This works but seems inefficient to do a CFHTTP call each time a CF page loads, so I'd like to cache the process. I was going to put the CFCACHE tag in my CF include file, but am not sure this will work as expected as won't this try to cache the whole CF page, rather than just the CFHTTP process within the include? (which is what I want)
Am I approaching this all wrong? Can anyone help?
Thanks in advanced for your help.
Can someone please help me with caching advice?
I want to access a snippet of code (from my own server) to include on my CF scripts. Specifically, it is my website header which contains some SSIs (#include). (My site is mostly static with a couple of CF scripts only.)
Sample header code:
quote:
<div id="access">Skip links here</div>
<div id="header">
<div id="logo">logo here</div>
<div id="tools">e.g. help, sitemap, contact us</div>
<div id="banner">pretty graphic here</div>
<!--#include virtual="/sitenav.shtml"-->
</div>
I thought to workaround this by creating a CF include that used CFHTTP to get the fully parsed header then include it into the CF pages. This works but seems inefficient to do a CFHTTP call each time a CF page loads, so I'd like to cache the process. I was going to put the CFCACHE tag in my CF include file, but am not sure this will work as expected as won't this try to cache the whole CF page, rather than just the CFHTTP process within the include? (which is what I want)
Am I approaching this all wrong? Can anyone help?
Thanks in advanced for your help.