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.

Cache-Control Static.json Clarification #190

@seanquinn

Description

@seanquinn

I'm unsure whether to add a Cache-Control header on the route / or on /index.html.

I'm having issues with users seeing older versions of the app. I want to ensure that on subsequent load of the app - they get the latest version without sacrificing the performance of the app as mentioned in #52.

Should I add the "Cache-Control" header for the root / or /index.html?

Option 1

{
  "root": "build/",
  "https_only": true,
  "headers": {
    "/**": {
      "Strict-Transport-Security": "max-age=31536000; includeSubDomains;",
      "X-Frame-Options": "DENY",
      "X-XSS-Protection": "1; mode=block",
      "X-Content-Type-Options": "nosniff"
    },
    "/index.html": {
      "Cache-Control": "no-store, no-cache"
    }
  },
  "routes": {
    "/**": "index.html"
  }
}

Option 2

{
  "root": "build/",
  "https_only": true,
  "headers": {
    "/**": {
      "Strict-Transport-Security": "max-age=31536000; includeSubDomains;",
      "X-Frame-Options": "DENY",
      "X-XSS-Protection": "1; mode=block",
      "X-Content-Type-Options": "nosniff"
    },
    "/": {
      "Cache-Control": "no-store, no-cache"
    }
  },
  "routes": {
    "/**": "index.html"
  }
}

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