微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Google Cloud Storage - 无法覆盖文件

如何解决Google Cloud Storage - 无法覆盖文件

我正在尝试使用 Google Cloud Storage (GCS) 为网站(例如 css、js 等)提供静态内容 所以我上传style.css,它服务很好——然后我对style.css做了一个修改,再次上传——GCS仍然服务原始版本......

我尝试删除文件。该链接仍然存在并且仍在提供原始版本。 我又上传了仍在服务原始版本....

Google Cloud Storage documentation 表示对象是不可变的,但您可以替换对象:

但是,可以替换存储在 Cloud Storage 中的对象,并且会自动执行此操作:在新上传完成之前,将旧版本的对象提供给读者,并在上传完成后提供新版本的对象对象是为读者服务的。因此,单个替换操作只是标志着一个不可变对象生命周期的结束和一个新的不可变对象生命周期的开始。

但这显然行不通。 我正在通过 UI(而不是 CLI)上传文件

帮助!我即将得到一个 AWS S3 来存储静态内容,违背了使用 GCP 的目的!!!

MPX

解决方法

当您更改到新版本时,您必须记住有 library(shiny) library(shinyWidgets) library(shinyjs) categoriesList <- c("Research","Rural Health","Staff Experience","Teamwork","Telehealth","Transition Care","Trauma and Injury Management","Unwarranted Clinical Variation") departmentsList <- c("Acute Medicine,Subacute and Community","Speciality Medicine,Cancer and Critical Care","Surgery and Interventional Services","Children's","Women's and Newborn","Mental Health","Allied Health and Patient Flow","Residential Care","Pathology","Imaging","Pharmacy") organisationsList <- c("Organisation 1","Organisation 2","Organisation 3","Organisation 4","Organisation 5","Organisation 6","Organisation 7","Organisation 8","Organisation 9","Organisation 10","Organisation 11","Organisation 12") statusList <- c("Sustained","Implementation","Pre-implementation","Future Initiative") ui <- fluidPage( titlePanel("App"),mainPanel( selectizeInput("selectedTags","Select",choices = list( Categories = categoriesList,Departments = departmentsList,Organisations = organisationsList,Status = statusList),multiple = TRUE,options = list('plugins' = list('remove_button'))),checkboxGroupButtons("selectedCategories",choices = categoriesList,individual = TRUE),checkboxGroupButtons("selectedDepartments",choices = departmentsList,checkboxGroupButtons("selectedOrganisations",choices = organisationsList,checkboxGroupButtons("selectedStatus",choices = statusList,individual = TRUE) ) ) server <- function(input,output,session) { observeEvent(input$selectedCategories,{ updateSelectInput(session,"selectedTags",selected = c(input$selectedTags,input$selectedCategories)) }) observeEvent(input$selectedDepartments,input$selectedDepartments)) }) observeEvent(input$selectedOrganisations,input$selectedOrganisations)) }) observeEvent(input$selectedStatus,input$selectedStatus)) }) } shinyApp(ui = ui,server = server) 。浏览器将显示旧版本,直到值中设置的时间过去。

请务必记住,Cache-Control metadata 的默认值是 3600 秒。所以如果不设置新版本的文件,浏览器会延迟显示。

请检查 documentation 以获取缓存控制元数据。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。