2017-09-27 5 views
2

사용자 정의 도메인을 사용하는 웹 응용 프로그램이 있습니다. 이 도메인에는 151.101.1.195 및 151.101.65.195에 매핑 된 A 레코드가 있습니다.Firebase 호스팅 헤더 규칙에서 도메인 루트를 대상으로하는 방법

모든 것이 제대로 작동하지만이 같은 firebase.json 때 :

accept-ranges:bytes 
cache-control:max-age=3600 
content-encoding:gzip 
content-length:839 
content-type:text/html; charset=utf-8 
date:Wed, 27 Sep 2017 06:54:58 GMT 
etag:"f0b36e6c2a348eb46d07907fea856e9a" 
last-modified:Wed, 27 Sep 2017 06:53:07 GMT 
server:nginx 
status:200 
strict-transport-security:max-age=31556926 
vary:Accept-Encoding 
via:1.1 varnish 
x-cache:HIT 
x-cache-hits:2 
x-powered-by:Express 
x-served-by:cache-bma7024-BMA 
x-timer:S1506495298.256593,VS0,VE0 

나는 캐시 제어를 기대 : 나는 https://mycustomdomain.com를 방문 할 때

{ 
    "hosting": { 
    "public": "dist", 
    "headers": [{ 
     "source": "**/*.html", 
     "headers": [{ 
     "key": "Cache-Control", 
     "value": "private, max-age=0, no-cache" 
     }] 
    }] 
    } 
} 

나는 아직도이 같은 응답 헤더를 참조 헤더가 수정되지만 변경되지는 않습니다.

어떻게 도메인 루트의 응답 헤더를 변경할 수 있습니까? 사람이 찾고 들어

답변

0

, I는 다음과 같이 그 일을 결국, 작동하는 것 같다 :이 또한 기능과 함께 작동

{ 
    "hosting": { 
    "public": "dist", 
    "headers": [ 
     { 
     "source": "/", 
     "headers": [{ 
      "key": "Cache-Control", 
      "value": "private, max-age=0, no-cache" 
     }] 
     }, 
     { 
     "source": "**/*", 
     "headers": [{ 
      "key": "Cache-Control", 
      "value": "private, max-age=0, no-cache" 
     }] 
     }, 
     { 
     "source": "**/*.js", 
     "headers": [{ 
      "key": "Cache-Control", 
      "value": "max-age=31536000" 
     }] 
     }, 
     { 
     "source": "**/*.css", 
     "headers": [{ 
      "key": "Cache-Control", 
      "value": "max-age=31536000" 
     }] 
     }, 
     { 
     "source": "**/*.jpg", 
     "headers": [{ 
      "key": "Cache-Control", 
      "value": "max-age=31536000" 
     }] 
     }, 
     { 
     "source": "**/*.png", 
     "headers": [{ 
      "key": "Cache-Control", 
      "value": "max-age=31536000" 
     }] 
     } 
    ], 
    "rewrites": [ 
     { "source": "/api/1/mina", "function": "mydata" }, 
     { "source": "**", "destination": "/index.html" } 
     ] 
    } 
} 

합니다. 캐시 분할 URL을 사용하므로 .js 파일도 적극적으로 캐시됩니다.