Skip to content

Commit b3b6c82

Browse files
committed
Add some cache expiration directives to the .htaccess file
SF's project web servers implement a caching system to speed up website loading times, but this makes website testing difficult on short timescales. These ExpiresByType directives are obeyed by the caching system, and can be adjusted to speed up future development.
1 parent 05d8b26 commit b3b6c82

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.htaccess

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,39 @@ rewritecond %{http_host} ^pdl.sourceforge.net [nc]
33
rewriterule ^(.*)$ http://pdl.perl.org/$1 [r=301,nc]
44

55
Redirect permanent /PDLdocs/Intro.html http://pdl.perl.org/PDLdocs/PDL.html
6+
7+
#Expires Rules modified from https://gist.github.com/boogah/1842173
8+
<IfModule mod_expires.c>
9+
ExpiresActive on
10+
11+
# Perhaps better to whitelist expires rules? Perhaps.
12+
ExpiresDefault "access plus 0 seconds"
13+
14+
# Data
15+
ExpiresByType text/html "access plus 0 seconds"
16+
ExpiresByType text/xml "access plus 0 seconds"
17+
ExpiresByType application/xml "access plus 0 seconds"
18+
ExpiresByType application/json "access plus 0 seconds"
19+
20+
# Favicon (cannot be renamed)
21+
ExpiresByType image/x-icon "access plus 1 week"
22+
23+
# Media: images, video, audio
24+
ExpiresByType image/gif "access plus 1 month"
25+
ExpiresByType image/png "access plus 1 month"
26+
ExpiresByType image/jpeg "access plus 1 month"
27+
ExpiresByType video/mp4 "access plus 1 month"
28+
ExpiresByType video/mpeg "access plus 1 month"
29+
30+
# Webfonts
31+
ExpiresByType application/x-font-ttf "access plus 1 month"
32+
ExpiresByType font/opentype "access plus 1 month"
33+
ExpiresByType application/x-font-woff "access plus 1 month"
34+
ExpiresByType image/svg+xml "access plus 1 month"
35+
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
36+
37+
# CSS and JavaScript
38+
ExpiresByType text/css "access plus 0 seconds"
39+
ExpiresByType application/javascript "access plus 1 year"
40+
41+
</IfModule>

0 commit comments

Comments
 (0)