Support » How-To and Troubleshooting » admin.php -> What does the header(‘X’) do?

admin.php -> What does the header(‘X’) do?

  • header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: no-cache, must-revalidate, max-age=0');
    header('Pragma: no-cache');

    What do these do? I had a problem with a plugin, and apparently these lines were causing trouble. If I edit them out, does it greatly affect anything?

    Many thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sends HTTP headers. I think those ones in effect tell the browser and intermediary proxies to not cache the page at all.

    Woah! Obviously important. Tried commenting them out, everything seemed fine.

    Then, logged out and everything went pfft.

    So don’t bother answering my question – sorry for wasting time.

    I’ll just add a bit to what Firas said. This code is added when the page is very dynamic and the user should always load it from the server instead of from their caches. So no, editing them out won’t cause any harm. I’m curious, what plugin did this, and what was the context etc.?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘admin.php -> What does the header(‘X’) do?’ is closed to new replies.