Open In App

HTTP headers | Access-Control-Max-Age

The Access-Control-Max-Age HTTP header is a response header that gives the time for which results of a CORS preflight request that checks to see if the CORS protocol is understood and a server is aware using specific methods and headers, can be cached. The CORS preflight request contained in the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers.

Syntax:



Access-Control-Max-Age: <delta-seconds>

Directives: This header accepts a single directive mentioned above and described below:

Note: If -1 is present then caching is disabled.



Examples:

To check this Access-Control-Max-Age in action, go to Inspect Element -> Network check the response header for Access-Control-Max-Age like below, Access-Control-Max-Age is highlighted you can see.

Supported Browsers: The browsers are compatible with HTTP Access-Control-Max-Age header are listed below:

Article Tags :