4 ms·
Many comments seem to focus on traditional GET requests in which case long URLs are usually a smell. But there's a rather new requirement in the web that confli
by bmuon 14y ago
Many comments seem to focus on traditional GET requests in which case long URLs are usually a smell. But there's a rather new requirement in the web that conflicts with limits on URL length: the use of modules for front-end JavaScript code. The best practice for modules is usually expressed as:
1) Write small modules
2) Concatenate scripts
If you try to automate module concatenation then you'll get URLs like http://example.com/combo?foo.js&bar.js&baz.js http://example.com/combo?foo.js&bar.js&baz.js, which combined with "write small modules" can mean a long list of small modules that easily reaches 2000 characters.
- grncdr 14y agoWhat is the use case for concatenating scripts on request rather than as a build step?
- maw 14y agoNot having a build step at all. That's worth aiming for if you can do it without hamstringing yourself, but it isn't how I would go about it.
- jap 14y agoOne use case is if the scripts are part of a large framework on a 3rd party server. See e.g. the YUI 3 library configurator: http://yuilibrary.com/yui/configurator/ http://yuilibrary.com/yui/configurator/