Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46025

REST APIs responses are not set with appropriate cache controls

    • Blue Ocean 1.2

      The REST responses from Blue Ocean don't have any cache control in the header ie:

      cache-control:"no-cache, no-store, no-transform

      Which causes IE to cache the responses.

      ie. This means that IE users will not see newly added pipelines

      To reproduce this:

      • In IE visit the pipelines view. Close it.
      • In a different browser, create a new job that should be visible in the pipelines view
      • Open the pipelines view again in IE. The new pipeline won't be visible until the cache is deleted or you open developers tools and disable the it.
         

          [JENKINS-46025] REST APIs responses are not set with appropriate cache controls

          Alvaro Lobato added a comment -

          jamesdumay michaelneale vivek my proposal to fix this would be to add 

           

          response.setHeader("cache-control", "no-cache, no-store, no-transform");

          here:

          https://github.com/jenkinsci/blueocean-plugin/blob/cb8a9140b5f6777c176c45025ca6f97630d70441/blueocean-rest/src/main/java/io/jenkins/blueocean/rest/ApiHead.java#L89 

          Before returning and only if that header hans't been set, allowing that way the Containers, etc to override it.

          WDYT?

           

          cc: teilo

          Alvaro Lobato added a comment - jamesdumay michaelneale vivek my proposal to fix this would be to add    response.setHeader( "cache-control" , "no-cache, no-store, no-transform" ); here: https://github.com/jenkinsci/blueocean-plugin/blob/cb8a9140b5f6777c176c45025ca6f97630d70441/blueocean-rest/src/main/java/io/jenkins/blueocean/rest/ApiHead.java#L89   Before returning and only if that header hans't been set, allowing that way the Containers, etc to override it. WDYT?   cc: teilo

            alobato Alvaro Lobato
            alobato Alvaro Lobato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: