0

If I have two headers like:

header("Cache-Control: public");
header("Cache-Control: private");

Which will be effective (first or last)?

AbraCadaver
  • 78,200
  • 7
  • 66
  • 87

1 Answers1

1

On this script the second header() will be used:

<?php
    header('Location: http://google.de');
    header('Location: http://stackoverflow.com');

On your script the second header() will be used:

<?php
    header("Cache-Control: public");
    header("Cache-Control: private");

If a header was defined multiple times, the last one will be used!

Sebastian Brosch
  • 42,106
  • 15
  • 72
  • 87