I would like to monitor the availability of a data driven page that has been known not to load due to being unable to create the temporary files required by the image resize function. It’s happened a handful of times since launch in April/May and my host restarts the server to solve the problem - not sure that’s the best way but that appears to be what they do. I’m uncertain as to whether uptime monitoring would inform me of failure to load the page in question as I’m not sure what exactly these types of services are checking. The availability of the site as a whole doesn’t seem to be a problem, but the site’s main purpose is to promote the business and advertise properties on its properties page and the availability of this page is, therefore, absolutely crucial to the likely longterm success of the site.
I know this is probably a very basic question, but if someone can point me in the right direction, I would be most grateful.
The main property image file exists. It is resized just for the property list page. 90% of the time it works then it fails for no apparent reason. Even with no new files. Support have offered to look into it for me & I think I need to put some proper error handling in place. It’s just the page that fails, by the way, not the whole site
The first block of resizing code is for a ‘feature’ area:
<!— Display the Featured Property —>
<!— Property Name, Short Description, Price and Image —>
<!— Resizing the image allows me to keep a full size image in the database for use with the schedule —>
<table title=“Featured Property”>
<tbody><cfimage source=“properties/#GetProperty.propertyname#/images/#GetProperty.imagefilename#” action=“resize” width=“60%” height=“60%” destination=“properties/#GetProperty.propertyname#/images/#GetProperty.imagefilename#feature_sm.jpg” overwrite=“true”>
It’s called by this code:
<td title=“Featured Property Image - Click for Full Details”>
<img src=“properties/#GetProperty.propertyname#/images/#GetProperty.imagefilename#_sm.jpg” alt=“Image of property called #GetProperty.propertyname#” />
Then, this resize code is used in the main body of the page:
<td title=“Property Image for #show_properties.propertyname# - Click for Full Details”>
<img src=“properties/#show_properties.propertyname#/images/#show_properties.imagefilename#_sm.jpg” alt=“Image of property called #show_properties.propertyname#” />
Thanks for answering my post. Hopefully you might spot something I haven’t thought of. Either way, I still think I need some exception handling code in there to prevent the whole page from falling over because the file cannot be created.
Thanks for your advice. I’ll certainly consider it. I’d like to try to stick with the ColdFusion resize code but it needs NOT to put the page down with a hideous error message! I should be able to prevent that happening if the file has already been created before - i.e. if a temporary file already exists, I probably ought to be simply displaying that rather than getting it to recreate it each time.
To answer your question about what the site does. It’s a website for a Solicitors/Estate Agents and most of the pages clients see are static but the properties.cfm page is a listing (like a product catalogue) of all the properties my clients have for sale or let at the moment. There is a feature box at the top of the page which displays the different properties in turn - a different one each time the page is reloaded rather than a slideshow - and then the rest of the page just has the rest of the properties listed in the same way but outwith the feature box. The basic listing is small image + text and this takes the image the client has uploaded as the main property image and resizes it to a smaller size for display on the properties listing page. This means my clients only have to upload the images they want and resize them once before they upload them - it’s to simplify things for my clients. As they may add a property through the web forms behind the login during the day, it probably wouldn’t work to resize them once at the beginning of the day, but as I said, all suggestions are welcome and I’ll consider it if I can’t sort out the image resize function that’s there.
I should also say that the service I have monitoring the site will, in fact, alert me when the page gives this error page by the looks of things as it alerted me yesterday when a 503 error was given and then a few minutes later when the status changed back to 200 - OK. It was useful to know that the page was down for 5 minutes and that this is obviously going to be picked up. Equally, the monitoring service said I could specify the page itself in the URL and I would then have that page specifically monitored, which might be quite useful.