In my application.cfc file I have the following code:
this.mappings["/includes"] = "#expandPath('../../priv/inc/')#";
and then on a page I have the following CF include set up:
For the majority of the time when the page is submitted the imageOptimise-thumbnail page runs without any issue but occasionally it will error saying that it can't find the imageOptimise-thumbnail.cfm. If I resubmit the page, chances are it will work but the question is, why is it sometimes not being able to find the page?
I had a look in the CF Admin and I can't see anything in the logs saying that there was an error but it is clearly showing a Coldfusion 'template not found' error message when it fails.
Anyone got any ideas?
We've been suffering from this for ages, and I have not found a solution for it. Our org inbox is inundated with emails triggered when the header.cfm page cannot be found.
^ _ ^
Does adding the runonce attribute help? Assuming you're on ColdFusion 10 or above, the syntax is
<cfinclude template="/includes/imageOptimise-thumbnail.cfm" runonce="true">
Oh, and just an aside, I would avoid using a dash in a CFML file name.