Open In App

HTTP headers | Clear-Site-Data

Last Updated : 31 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The HTTP header Clear-Site-Header is a response-type header. This header is used in deleting the browsing data which is in the requesting website. These browsing data includes cache, cookies, storage and executionContents. It helps the web developers to have an improved level of control over data stored by the browser locally.

Syntax:

Clear-Site-Data: "cache"|"cookies"|"storage"|"executionContexts"|"*"

Note: The data to be deleted, directibves should be given within double quotes (” “). Multiple directives can be given at a time.

Directives: This header accepts four directives mentioned above and described below:

  • “cache”: It represents that the server wishes to remove locally cached data.
  • “cookies”: It represents the server wishes to delete all the cookies for the origin of response URL.
  • “storage:” It represents the server wishes to remove locally stored data.
  • “executionContents”: It represents the server wishes to remove all the browsing contents for the origin of response URL.
  • ” * “: It represents the server wishes to delete all types of data for the origin of response URL.

Examples:

  • In this example header wants to delete the cache, cookies, storage and executionContents data.
    Clear-Site-Data: "cache", "cookies", "storage", "executionContents"
  • In this example header wants to delete all the data.
    Clear-Site-Data: " * "

Based on the directives mentioned, the corresponding type of data will be removed. To check the Clear-Site-Data go to the Inspect Element->Network click any visible name after that click the header tab if this header is used then it will be visible to you.

Supported Browsers: The browsers compatible with HTTP Clear-Site-Data headers are given below.

  • Google Chrome
  • Firefox
  • Opera

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads