Skip to content

static files referenced in plotly_header/footer redirect to /static, why not directly /static #323

@sdementen

Description

@sdementen

I have noticed that the {% plotly_header %} and {% plotly_footer %} command in the template generates reference of the form:

  • /static/path/to/file
  • https://some-external-site
  • /django_plotly_dash/instance/... => this will redirect to an asset hosted on /static
    Example in the header
<link rel="stylesheet" href="/static/dpd/assets/simulation/dashapps/vizualizer/layout.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="/django_plotly_dash/instance/visualizer-pb8qnxg-nazykxn/_dash-component-suites/dpd_static_support/bootstrap.v0_1m1608548852.min.css">

In the footer, they are all of the form /django_plotly_dash/instance/....
This latter form is problematic as I do not see how to serve those files efficiently as static files. Each asset will make a call through django (with all the middleware/etc) before returning a 302 redirecting to /static (which can easily be managed as static files).

Is that the expected behavior ?
Can this be changed to avoid the performance penalty when loading the app ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions