Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PATCH: Increase the OEmbed sizeLimit from 250 KB to 1 MB
SAPI IG Articles have massive `<head>` elements, with massive `<style>` blocks, which push the `<meta>` tags we are interested in beyond vanilla’s 250 KB `fetch()` sizeLimit, causing Preview Links to miss out on important data. A copy of the fetched html is stored in `db.rocketchat_oembed_cache#data.content.body`, so increasing the sizeLimit impacts our storage requirements. In practice, the impact isn't so great. Pages are cached only for a week. On Mongo/Production, we have under 1500 docs, only 600 of which reach the 250k limit. Assuming _all_ of those would hit the higher 1 MB limit, that's an increased storage of 450 MB. ``` ((1 * 1024 * 1024) - (250 * 1024)) * 600 / 1024 / 1024 //=> 453.5 MB ``` TODO: An improvement on this would be to extract out only the `<head>` element from the html, strip out `<style>` and `<script>` elements from it, and store the rest.
- Loading branch information