Slow Rendering Plotly Expess Choropleth Map

Hello,

Any idea how to optimize the code below so the map will render faster? It takes at least 30s for the map to show. Other graphs are okay.

ct_geo.json is about 4MB. I have it in streamlit.

def load_geo_json():
    file_contents = open('assets/ct_geo.json', 'r')
    return json.loads(file_contents.read())

zipcodes = load_geo_json()

fig = px.choropleth(df_active_num_dynamic, 
                                geojson=zipcodes, 
                                locations='postalcode', 
                                color='Active',
                                color_continuous_scale="Sunset",
                                range_color=(0, df_active_num_dynamic['Active'].max()),
                                featureidkey="properties.ZCTA5CE10",
                                scope="usa",
                                custom_data=["postalcode", "Active", "city",]
                                # labels={'Active':'# of Active Listings'}
                                )

            fig.update_geos(fitbounds="locations")
            fig.update_traces(
                hovertemplate="<br>".join([
                    "Zip Code: %{customdata[0]}",
                    "# of Actives: %{customdata[1]}",
                    "City: %{customdata[2]}",
                ])
            )

            fig.update_layout(height=500, margin={"r":0,"t":0,"l":0,"b":0})
            st.plotly_chart(fig, use_container_width=True)

streamlit has a cache function. It may take longer the first time, but the time will be greatly reduced the next time. See this for details.
https://docs.streamlit.io/library/advanced-features/caching

Thanks! my map is dynamic so every time the user changes the drop down for the map, it will refresh the whole page and the cache function doesn’t help. I am more wondering if the map itself has some parameters or some sort to speed up the processing time. Thank you