Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>In your question, you're talking about:</h2> <ol> <li><a href="http://developer.yahoo.com/performance/rules.html#expires" rel="nofollow">Adding Expire headers for caching</a> </li> <li><a href="http://developer.yahoo.com/performance/rules.html#split" rel="nofollow">Splitting resources across domains</a></li> </ol> <p>For Item #1, you can edit your httpd.conf/.htaccess file on your main domain (it doesn't hurt doing it on your whole website, no?)</p> <pre><code>&lt;IfModule mod_expires.c&gt; ExpiresActive On ExpiresByType application/x-javascript A2592000 ExpiresByType image/gif A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType image/png A2592000 &lt;/IfModule&gt; </code></pre> <p>Item #2 doesn't need any Apache configuration - just configure your static.photography.example.com DNS entry with <em>CNAME photography.example.com</em>. That should do the trick.</p> <p>Or you can edit your httpd.conf and add a ServerAlias</p> <pre><code>&lt;VirtualHost xx.xxx.xxx.xx:80&gt; DocumentRoot / ServerName photography.example.com ServerAlias static.photography.example.com &lt;/VirtualHost&gt; </code></pre> <h2>So for now, you don't need a separate virtual host with dedicated Apache configuration.</h2> <p>Here are a few other reasons why you'd want <strong>a separate domain, and a separate virtual host with dedicated configuration</strong>:</p> <ul> <li>Your main domain has cookies and you want to <a href="http://developer.yahoo.com/performance/rules.html#cookie_free" rel="nofollow">use a cookie-free domain</a></li> <li>You <a href="http://developer.yahoo.com/performance/rules.html#cdn" rel="nofollow">actually want to use a CDN</a> (or your Amazon S3 account to reduce bandwith on your primary hosting) </li> </ul> <p>If you want one of those, or if your caching needs are too complex (you don't want to cache all JS/CSS/images, but rather a subset of it), then your only solution is: <strong>get your hands on your httpd.conf and write separate configurations for each domain</strong> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload