Unpkg used to hack
This sort of thing is difficult to test in isolation because it involves more than just the code in this repo it involves the Cloudflare config as well.Īnyway, I've reverted the Cloudflare setting so everything should work as it did before the change and I apologize for any inconvenience this may have caused. So Cloudflare started sending all the query strings through to the origin server which issued 403s. This breakage was actually introduced when I changed a setting on Cloudflare (invisible to all of us here, unfortunately ?) that started caching files by the pathname + the query string instead of just the pathname. You can see in the commit log that the code was already checking for invalid queries previous to the deploy made a few days ago. Just looking into this a little more, this breakage was not actually introduced by a change to the code in this repo. a commit SHA) as the value instead of just using a timestamp so that they can get the cache busting behavior they desire and we can get good caching. It's my hope that they will put a real version number or equivalent (e.g. My plan going forward is to add official support for the v query parameter as a way for library authors who want to use cache busting. So version numbers in the query string are not only harmful on unpkg, they're not actually necessary either. those that contain a semver string) redirect to a URL with a real version number in the URL. All unpkg URLs that do not contain a fully-resolved version number (e.g. When I designed the unpkg URLs, I put the package version number right in the URL. This is the brute-force method of dealing with cache invalidation problems that "fixes" things by opting out of the cache entirely. For example, many people are using a query string like ?_=timestamp where every single page load will trigger requests that bypass the cache (see #50) and hit the origin server. It's a common technique when working with browser caches, but it makes the CDN pointless. The larger issue here is people using query parameters as a way to bypass the cache. The good news is I already added back support for the v query parameter in f5be48f and cleared the cache so this should be fixed. In this case I inadvertently changed the behavior of the code (I thought we were already checking for invalid query parameters, but apparently not) so I did not intend to break anyone's sites. It sucks when stuff breaks, and people often lose their cool when it does. Thanks for the report and for the level-headed conversation. If you believe that this is intended behaviour, I respect your judgement but in the interest of time we will have to revert back to self hosting or hack out our custom cache busting. Or you can treat 'v' as another accepted query parameter.Īgain, thank you very much for your work. My suggestion is to NOT do a 403, and simply ignore other unknown variables. As Linus says: "You do not break user space!" Unfortunately, this means that with your recent changes completely unbeknownst to us, you have broken our website (and potentially many others).
this also affects things like css font loading from your service as well.and in general is also added for cache busting reasons in most bespoke algorithms, or by other tools like server-side frameworks, or front end packing tools.the v= parameter is added by many other tools (yes, jQuery) by default for cache busting.appending the v= parameter in query string now returns a 40x and breaks.To serious business: you may have just broken a number of websites relying on your service.
#Unpkg used to hack full#
First off, let me say I have full appreciation for the work done in this project and the unpkg CDN in general. Currently, though, it’s something like this. What does it look like? Well, the exact standards are being worked out. Based on that, we can then apply different styles to the children of said container. Much like we have media queries for querying things such as the viewport size, a container query allows us to query the size of a container. So, what is a container query? It’s… exactly that. After we have a poke at the basics ourselves, we’re going to build something super fun with them: a fresh take on the classic CSS meme featuring Peter Griffin fussing with window blinds. We’re going to look at the basics here, but if you’d like another look, check out Una’s “Next Gen CSS: article. If you follow new developments in CSS, you’ve likely heard of the impending arrival of container queries.