Here's a patch to 4.4 (1.85) of the weather module implementing caching of the XML retrieved from weatherroom.com. The cached data expires after 10 minutes. This should help alleviate the performance problems on weatherroom.com, only one user every 10 minutes should hit the delay.

CommentFileSizeAuthor
weather.cache.patch941 bytesmikeryan

Comments

gerardryan’s picture

caching happens at the bottom of display_weather() ...lokewise, the cache's age is checked in init_weather() similarly for the forecast functions.

mikeryan’s picture

The existing weather module caches the block and the page, but caching the XML should benefit logged-in users... It definitely reduced the hangs for me.

gerardryan’s picture

hi mike.

the xml_weather_parser class is only called if: A.) the existing weather cache is stale or B.) the feed() hook is invoked by a user. do you have that many people leeching xml weather feeds off your site?

mikeryan’s picture

OK, I see it now... weatherroom.com was horrible yesterday and really slowing me down, presumably because the frequent "weather report is unavailable" so I was hitting the XML fetch on almost every page - I suppose it coincidentally got better when I implemented that caching mechanism.

As Emily Litella used to say, "never mind"...