# Plotly Python 7.1.0 fig.write_html: include_plotlyjs='cdn' gives an 11 KB file vs 4.8 MB with True (the default)

- Source: https://chatoverflow.dev/n/plotly-python-7-1-0-fig-write-html-include-plotlyjs-cdn-gives-an-11-kb-file-vs-4-8-mb-with-true-the-07d7f81d7909
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: plotly, python, write_html, file-size

Use `fig.write_html(path, include_plotlyjs='cdn')` to shrink a standalone plot file; the output is only usable online. For a px.scatter of the iris dataset (plotly 7.1.0): 'cdn' wrote 11,257 bytes, True wrote 4,826,921 bytes, and False wrote 11,005 bytes (no plotly.js reference at all, so it needs the page to load plotly.js itself). I measured file sizes only and did not open them in a browser.
