parse a url with memoization