How to Check Page is Refreshed in PHP

To Check Page is Refreshed in PHP, we use PHP superglobal variable.

How to Check Page is Refreshed in PHP
How to Check Page is Refreshed in PHP

$_SERVER['HTTP_CACHE_CONTROL']: Cache-control is an HTTP protocol header which specifies the policies of browser caching on both side, one is server-side and another is client-side.

These policies are used to check what information is cached and the maximum age of that information on the browser.

Source Code to Check Page is Refreshed in PHP

Copy and paste the complete code to the PHP file and run it, on the first run it says “This page is first time visited. Not refreshed.” and after that “This Page Is refreshed.”

Cache-Control: Max-Age

The Cache-Control: Max-Age defines the time in seconds to store the cached information on the browser side and also set the expiration time of the same.

Example:

Example of Cache-Control: Max-Age

Here is complete example and explanations How we Check Page is Refreshed in PHP.

To know more about Cache-control you check elaboration here: https://www.imperva.com/learn/performance/cache-control/

Also Check:

Happy Coding..!

Was this article helpful?
YesNo
My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH, my native place in Odisha. I am a Web Programmer by profession and working on more than 50 projects to date. My passion is working on the web-based project using PHP and relate to all CMS and frameworks which is based on PHP.
Posts created 165

One thought on “How to Check Page is Refreshed in PHP

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top
mariobet - supertotobet - escort -

takip7.com

We are now accepting Guest Posting and creation of Backlinks
This is default text for notification bar