3 ms·
I saw a truly truly awful codebase get around the caching bit by appending a random string of bytes to the query string. If you're willing to ignore the rules
by BoorishBears 4y ago
I saw a truly truly awful codebase get around the caching bit by appending a random string of bytes to the query string.
If you're willing to ignore the rules you can get away with pretty awful stuff that no one should really need to account for in a general conversation.
- imiric 4y ago> I saw a truly truly awful codebase get around the caching bit by appending a random string of bytes to the query string. This is a common cache busting technique. Why is it a bad thing?
- BoorishBears 4y agoWhy do I get the impression this is a leading question... If you have the option between cache busting and just using the correct HTTP verb, please choose the latter. As to whether there was an option in this particular case, I think the fact I referred to it as a "truly truly awful codebase" should provide a hint.
- talideon 4y agoThe correct solution for cache busting is generally to put a low TTL on the resource in question. Adding random crap in the end is only good if you're dealing with utterly broken caches or your webserver does some tremendously stupid header rewriting. In my experience, when people resort to that, it's down to a lack of understanding of HTTP itself. YMMV, however.