Skip to content
This repository was archived by the owner on Jun 11, 2022. It is now read-only.
This repository was archived by the owner on Jun 11, 2022. It is now read-only.

Response headers using static.json and React Router #183

Open
@dcporter44

Description

@dcporter44

I am trying to set a header in static.json on ONLY my index.html file using:

headers: { "/": { "Cache-Control": "no-store" } }

The header works successfully when I specifically go to "https://mywebsite.com/"
But if I go to "https://mywebsite.com/sign-in", the header is not there. This is because /sign-in is not an actual file in my project. It is a route generated by React router.

I know I can use "/**" instead of "/" in static.json, but I don't want to add this header to my .css, .js, fonts etc.

Is there functionality available in static.json to apply headers to only the HTML file, no matter the route?

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy