Proper caching and cache avoidance.
This commit is contained in:
parent
945aab3813
commit
145f1549bd
11
.htaccess
11
.htaccess
|
@ -3,4 +3,13 @@
|
||||||
#RewriteCond %{REQUEST_FILENAME} !-d
|
#RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
#RewriteRule ^(.*)$ index.php [QSA,L]
|
#RewriteRule ^(.*)$ index.php [QSA,L]
|
||||||
|
|
||||||
# TODO - https://github.com/phanan/htaccess#set-expires-headers
|
<IfModule mod_expires.c>
|
||||||
|
ExpiresActive on
|
||||||
|
ExpiresDefault "access plus 1 week"
|
||||||
|
ExpiresByType text/html "access plus 0 seconds"
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
Header unset ETag
|
||||||
|
</IfModule>
|
||||||
|
FileETag None
|
2
one.php
2
one.php
|
@ -6,6 +6,8 @@ $config = require 'config.php';
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
header('Content-type: text/plain');
|
header('Content-type: text/plain');
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
|
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
|
||||||
try {
|
try {
|
||||||
$pdo = new MyPDO('sqlite:' . __DIR__ . '/' . $config['database']);
|
$pdo = new MyPDO('sqlite:' . __DIR__ . '/' . $config['database']);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue