Map: with no tile server, the world's outline is inlined into every map page instead of being a cached static file #1153
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#1153
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What exists today
jobs/outline.py:23-47parsestemplates/jobs/map/world_outline.html(39,066 bytes, one SVG path) into 278 rings, cached per process withlru_cache.jobs/views.py:781(the place picker of one company) andjobs/views.py:924(the companies' map) putoutline.rings()in the context whentiles.current().fetchedis false, andtemplates/jobs/company_map.html:33writes it intodata-map-outlinewithas_json(core/templatetags/postulo.py:800-807).static/js/app.js:9060and9203read it back. The template file is no longer included anywhere else; it is only a data source.Measured with the venv: the JSON is 44,682 bytes (only digits and brackets, so autoescaping adds nothing) and 14,220 bytes gzip. The ledger's 52 kB was high. Signed-in pages are
no-store(#787), so the attribute is sent on every view; the same data as a static file would be fetched once per release.The scout did not note that this applies only to
POSTULO_MAP_TILES=none(jobs/tiles.py:137-141); OpenStreetMap is the default since 2026-10-12, so most instances never send the outline. That is why the win is small.What would change
static/maps/world-outline.jsonfromworld_outline.html(the rings exactly asoutline.rings()returns them) with a small script, commit it, and have CI check it is current, like the other committed assets; or drop the SVG file and keep only the JSON as the one copy of the drawing.data-map-outline-src="{% static 'maps/world-outline.json' %}"instead of the data, andapp.jsfetches it (same origin, allowed byconnect-src 'self') before drawing the outline. WhiteNoise serves it hashed, gzip and Brotli compressed, and cached for good.outline.pyand itslru_cachego, unless something server-side still needs the rings.What it saves or protects
small: 44.7 kB of HTML (14.2 kB gzip) per view of the companies' map and of a company's place picker, only on instances whose tiles are set to None; the default, OpenStreetMap, sends none of it
Accessibility
none: the outline is decoration under Leaflet's markers; the map's table alternative (
data-map-table,company_map.html:135) is unaffectedDecisions
Found by the efficiency and reliability audit of 2026-10-30 (finding A7; index postulo/postulo#1108). Checked against
mainatdaee30b15(2026-10-30).