CFLOCK an image during parse
Hello, all,
About two years ago, we started having serious latency issues with our restricted portal. Many of us spent weeks trying to track down what the cause was.
The rest of us were scrambling trying to optimize the portal as much as we could, in the hopes that we could speed up the site load times. Part of this band-aid approach involved a custom-made News slideshow on the landing page. Instead of grabbing four UUIDs, Headlines, and images on every page load, we set up the application.cfc so that every two minutes the query would run and store the UUIDs, Headlines, and images into application variables, and pull from those.
Naturally, I placed an exclusive CFLOCK around the process in the application.cfc. But we are using a separate include for retrieving the images on page load, and part of that is using CFHEADER/CFCONTENT to serve up the images, passing an ID in the URL scope. This reduced the page load time by only a few seconds, but it helped.
Three weeks in, we finally came to the conclusion that a new STIG that had been applied was the culprit. We undid the portion of the STIG that was causing the issue, and voila!, the pages were loading much faster.
At the time we had other project to work on, so I left the above described process in place. And I don't currently have time to put it back to the way it originally was. However, we are now experiencing (and have been for quite some time) issues involving a missing array element related to the images. What I suspect is happening is that when the page loads, if it happens when the images are being refreshed, it's not finding the image in question because it's being overwritten by the application.cfc.
Is there a way to place a CFLOCK around the images during read so that the application.cfc can't overwrite images if they are being accessed for page load? Is it as simple as placing an exclusive CFLOCK around the CFHEADER/CFCONTENT tags?
V/r,
^ _ ^
