33 ms·
Why not sanitize it once when accessed, write the sanitized result back to the database and set a flag on the record. Use only presanitized strings if the flag
by corty 6y ago
Why not sanitize it once when accessed, write the sanitized result back to the database and set a flag on the record. Use only presanitized strings if the flag is set. After some time, when enough of your strings are flagged, run a sanitizer over the rest that hasn't been touched. That way you don't waste those milliseconds. However, I can imagine that this would waste quite some storage bandwidth because such a read is now a write as well.
- monsieurbanana 6y agoDoing that at the scale of facebook does not seem like a problem you can solve in a paragraph of explanations, which is the point of the blog: The longer you wait, the more difficult it is to solve.