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 created issue -

          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
          James Dumay made changes -
          Epic Link New: JENKINS-35759 [ 171771 ]
          James Dumay made changes -
          Sprint New: Blue Ocean 1.2-beta5 [ 376 ]
          James Dumay made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          James Dumay made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Alvaro Lobato made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Closed [ 6 ]
          Alvaro Lobato made changes -
          Assignee New: Alvaro Lobato [ alobato ]
          Vivek Pandey made changes -
          Remote Link New: This issue links to "Page (Jenkins Wiki)" [ 17446 ]
          James Dumay made changes -
          Rank New: Ranked higher

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

              Created:
              Updated:
              Resolved: