Search
 
SCRIPT & CODE EXAMPLE
 

PHP

How to prevent Browser cache for php site

Here, if you want to control it through HTML: do like below Option 1:

<meta http-equiv="expires" content="Sun, 01 Jan 2014 00:00:00 GMT"/>
<meta http-equiv="pragma" content="no-cache" />
  
And if you want to control it through PHP: do it like below Option 2:

header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');

AND Option 2 IS ALWAYS BETTER in order to avoid proxy based caching issue.
Comment

cache for php website

# Checks if the file is physically NOT present
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9-]+)+/([a-z0-9-]+).html$	/controller.php?partA=$1&partB=$2 [L]
Comment

PREVIOUS NEXT
Code Example
Php :: form validation nullable laravel 
Php :: php copy image from one folder to another 
Php :: using js variable in php 
Php :: php remove first and last char 
Php :: session_destroy not working 
Php :: laravel env production 
Php :: php get location of user 
Php :: encryption key has not encrypted laravel 
Php :: htaccess replace url parameter with slash prameter 
Php :: carbon parse sunday 30 days ago 
Php :: change php version linux nginx 
Php :: Get html by ajax 
Php :: laravel controller return message 
Php :: redirect back in codeigniter 
Php :: how to get length of object in php 
Php :: regex to check date format php 
Php :: xml to object php 
Php :: php session regenerate id 
Php :: carbon parse from format 
Php :: wordpress debug true 
Php :: php string max length 
Php :: Laravel factory avatars 
Php :: run php server mac 
Php :: php right characters 
Php :: how to switch from php7.4 to php7.3 mac 
Php :: wordpress convert non negative 
Php :: Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.", 
Php :: bind multiple data in one id in php using php using for loop 
Php :: laravel Postcontroller.php 
Php :: PHP Forward POST content into Python script 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =