Skip to content

Commit 6782c26

Browse files
committed
Added cache and expire headers.
1 parent f6a2431 commit 6782c26

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.htaccess

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
1+
<IfModule mod_headers.c>
2+
3+
Header set Connection keep-alive
4+
5+
Header unset Last-Modified
6+
7+
<FilesMatch "\.(js|css|xml|gz)$">
8+
Header append Vary Accept-Encoding
9+
</FilesMatch>
10+
11+
<FilesMatch "\.(ico|jpeg|jpg|png|gif|swf|css)$">
12+
Header set Cache-Control "max-age=5184000, public"
13+
</FilesMatch>
14+
15+
<FilesMatch "\.(js)$">
16+
Header set Cache-Control "max-age=5184000, private"
17+
</FilesMatch>
18+
19+
<FilesMatch "\.(xhtml|html|htm|php)$">
20+
Header set Cache-Control "max-age=5184000, private, must-revalidate"
21+
</FilesMatch>
22+
23+
</IfModule>
24+
25+
<IfModule mod_expires.c>
26+
27+
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$">
28+
ExpiresActive On
29+
ExpiresDefault "access plus 10 years"
30+
</FilesMatch>
31+
32+
</IfModule>
33+
134
RewriteEngine on
235
RewriteCond %{REQUEST_FILENAME} !-f
336
RewriteCond %{REQUEST_FILENAME} !-d
437
RewriteCond %{REQUEST_FILENAME} !-l
5-
RewriteRule ^(.*)$ /index.php
38+
RewriteBase /
39+
RewriteRule ^(.*)$ /index.php

index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
header( 'Content-Type: text/html; charset=utf-8' );
4+
header( 'Cache-Control: max-age=5184000, private, must-revalidate' );
45

56
require_once '_q/bootstrap.php';
67

0 commit comments

Comments
 (0)