Newton Ferrers and Noss Mayo weather
Newton Ferrers and Noss Mayo
Home : Weather : Tides : About : Contact

 Weather Tech
BBC Video Forecast
Spotlight News/Weather
Met Office Local Forecast
Met Office Shipping Forecast

Weather Tech

This tech. section is for users of WD (WeatherDisplay), weather web site developers & webmasters. Click here for our weather section!


PHP Image No Cache

OK so you have a great graphic design for your web pages, and photos and so on. You want them to be cached in your user's browser as they never change, and you want to save data transfer/bandwidth. However, you also have dynamic images which get regularly updated, and you don't want them to be cached. So what do you do?

This is forehead slappingly simple, but always overlooked! The usual method is the Pragma No-Cache which isn't always that reliable any way. However, this will (usually) prevent everything from being cached, including the static images such as those in your web site design. That will mean slower page load times, and increased data transfer/bandwidth.

If you have programmed your site in PHP there is a very simple solution! Simply add "?rand=<?=rand(1,1000);?>" to the end of dynamic image URLs. For example "/graph.jpg?rand=<?=rand(1,1000);?>". In other words, the images that are updated regularly, such as web cam, wind direction, etc. What this does is add a random number to the end of the image file name, and so the file name changes every time the page is reloaded! So your permanent graphics, such as design elements of your page, photos etc will be cached, but the dynamic images will never be cached!

Subscribe to our Weather Tech Email!

Not only can I keep you up to date with my own new scripts, script updates, and top tips, but I'm hoping to get other weather script and software developers to share their news and updates too. Use the form on the right to subscribe!

If you develop weather web scripts or software, we would like to feature your news in the Weather Tech email too! Please contact me for details.

Weather Tech Email
Stay up to date!
First Name

Horse Riding

Enjoy horse & pony riding at Newton Ferrers Equestrian Centre. Learn to ride at a fully equipped riding school. We also offer hacks, livery and we run a quarter horse stud.

Newton Ferrers Equus

Equestrian Classified Ads

Local gardens wanted for hedgehog release

N&N Email Service
W/E forecast & tides ..?
Daily forecast & tides ..?
Site Updates ..?
Your Email
Your First Name

You can cancel your subscription at any time.
The RYA Shorebased courses are starting next week at The Parish Rooms, Yealmpton.  We have 5 spaces left on the Day Skipper shorebased, Tues eve 7 - 9.30.  and 3 spaces left on the RYA Coastal Skipper/Yachtmaster class on Thursday eve.  Price £245.00 inclusive of books etc.  Please book on line at or phone 01548 810917.. 

Under Construction!
This is part of a larger site that is currently in development. More info will be available soon.

Page loaded in 0.0026 secs.

© 2001 - 2021