AeroGear Push
  1. AeroGear Push
  2. AGPUSH-343

Add Access-Control-Max-Age to CORS preflight headers

    Details

    • Similar Issues:
      Show 10 results 

      Description

      Making a preflight request on every request becomes expensive, since the browser is making two requests for every client registration request. Adding the Access-Control-Max-Age HTTP response header allows the browser to cache the preflight options request and should improve performance.

        Gliffy Diagrams

          Activity

          Hide
          Matthias Wessendorf added a comment -

          how many seconds do we want to use for the default ? Looks like the default could be pretty high...

          Show
          Matthias Wessendorf added a comment - how many seconds do we want to use for the default ? Looks like the default could be pretty high...
          Hide
          Daniel Bevenius added a comment -

          Matthias Wessendorf Yeah I agree that this could be a fairly high value. To avoid an issue if we need to update the server side how about setting it to 30 mins or something like that?

          Show
          Daniel Bevenius added a comment - Matthias Wessendorf Yeah I agree that this could be a fairly high value. To avoid an issue if we need to update the server side how about setting it to 30 mins or something like that?
          Hide
          Matthias Wessendorf added a comment -

          I thought about days not minutes
          Looking at https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS:

          "Finally, Access-Control-Max-Age gives the value in seconds for how long the response to the preflight request can be cached for without sending another preflight request. In this case, 1728000 seconds is 20 days."

          I'd say that's a pretty high value However I am not really sure if that is perhaps a bit too long...

          Show
          Matthias Wessendorf added a comment - I thought about days not minutes Looking at https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS: "Finally, Access-Control-Max-Age gives the value in seconds for how long the response to the preflight request can be cached for without sending another preflight request. In this case, 1728000 seconds is 20 days." I'd say that's a pretty high value However I am not really sure if that is perhaps a bit too long...
          Hide
          Kris Borchers added a comment -

          I think a really high value is fine. How often are you really changing CORS access parameters? If you're developing and making a CORS change, you can clear the browser's cache manually. I think something like 20 or 30 days is fine. If that feels too long, even a week (7 days) would be good.

          Show
          Kris Borchers added a comment - I think a really high value is fine. How often are you really changing CORS access parameters? If you're developing and making a CORS change, you can clear the browser's cache manually. I think something like 20 or 30 days is fine. If that feels too long, even a week (7 days) would be good.
          Hide
          Matthias Wessendorf added a comment -

          Going for seven days (604800 seconds), for now

          Show
          Matthias Wessendorf added a comment - Going for seven days (604800 seconds), for now
          Hide
          Christos Vasilakis added a comment -

          merged.

          Show
          Christos Vasilakis added a comment - merged.
          Hide
          Mike Gagnon added a comment -

          Just wondering if you guys happen to know how to clear the preflight cache on IE? It doesn't seem to clear when you clear normal browser cache...
          Thanks,
          Mike

          Show
          Mike Gagnon added a comment - Just wondering if you guys happen to know how to clear the preflight cache on IE? It doesn't seem to clear when you clear normal browser cache... Thanks, Mike
          Hide
          Lucas Holmquist added a comment -

          Mike Gagnon what version of IE?

          Show
          Lucas Holmquist added a comment - Mike Gagnon what version of IE?

            People

            • Assignee:
              Matthias Wessendorf
              Reporter:
              Daniel Bevenius
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development