mirror of
https://github.com/php/presentations.git
synced 2026-03-24 23:52:18 +01:00
30 lines
918 B
XML
30 lines
918 B
XML
<slide title="HTTP Optimization">
|
|
<blurb title="URL Shortening">
|
|
By using Apache's <i>mod_rewrite</i> module, you can greatly shorten your
|
|
HTML files by making common locations into one/two letter aliases.
|
|
</blurb>
|
|
<example fontsize="1.2em" title="Apache Mod_Rewrite Entry">
|
|
<![CDATA[RewriteMap abbr dbm:/etc/apache/abbr
|
|
RewriteRule ^/r/([^/]*)/?(.*) ${abbr:$1}$2
|
|
[redirect=permanent,last]
|
|
]]>
|
|
</example>
|
|
<example fontsize="1.2em" title="/etc/apache/abbr">
|
|
<![CDATA[
|
|
b bytes/
|
|
d dogs/
|
|
g graphics/
|
|
|
|
gt graphics/template/
|
|
]]>
|
|
</example>
|
|
|
|
<blurb title="HTTP Caching">
|
|
Use HTTP headers to have finer grained control over browser caching, these
|
|
headers include:
|
|
</blurb>
|
|
<example fontsize="1.2em" title="Headers"><![CDATA[Last-Modified: Mon, 22 Jul 2002 15:50:00 GMT
|
|
Expires: Mon, 22 Jul 2002 15:52:25 GMT
|
|
Cache-Control: must-revalidate, max-age=15, s-maxage=0, private]]>
|
|
</example>
|
|
</slide> |