This implementation looks almost identical to mine, except I placed this line beneath line 366 (in order to completely clear the cached status if someone called this function with a new url).