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 :: php .com 
Php :: php var_dump() 
Php :: Laravel DB facade relations 
Php :: header in fpdi 
Php :: laravel debugbar not showing 
Php :: php array merge without array_merge 
Php :: php javascript dynamic form 
Php :: Use the DebugBar like an array where keys are the collector names 
Php :: Mixed int and string keys 
Php :: put_assoc 
Php :: php how to concatenate strings 
Php :: myr currency symbol 
Php :: laravel gigapay delete payout 
Php :: extract date from DateTime object php 
Php :: codeigniter admin panel with crud generator - 
Php :: how i can send by database table in laravel full calendar 
Php :: redirect www to non-www wordpress multisite 
Php :: Primary Termmaatwebsite/excel store s3 
Php :: laravel 7 link to another page with language prefix 
Php :: Attempt to read property "headers" on string 
Php :: wc get_image() return image url 
Php :: Input sanitization to prevent XSS 
Php :: how can we send attached file with notification in gmail in laravel 8 
Php :: extension gd missing laravel composer update 
Php :: command ui is not found 
Php :: $order- date 
Php :: php mysqli connect to two databases pdo 
Php :: How to check if fwrite failed php 
Php :: subdomain ajax request fail in php 
Php :: if ( $post_armi-have_posts() ) { while ($post_armi-have_posts() ) { $post_armi-the_post(); 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =