In the last episode, we parsed the URL and then used the host element to check if the URL is local to our website. Shouldn’t we use that same strategy for our version query string check? Think about it. Why search the entire URL for the version key pattern when we could just search the query itself? Plus, if the asset was enqueued with the version number set to null, then query may not even be in the parsed URL. Let’s improve our code. Then we’ll walk through all of the checks and make each one readable without an inline […]
