Parallel Content File Downloads and Cookieless Domains

Parallel Content File Downloading

Browsers usually have a limit on how many files (images, css, js) they can retrieve from a site at any given moment.  To help page load times, you can use parallel downloading of files so that the browser will download more files at the same time, which can reduce your page load times.  This also increases your overall connections to the server, which may cause resource limits being reached. 

Cookieless Domains:

Cookieless domains are domains that do not set a cookie on the browser.   Cookies are usually set by scripts for session tracking.  By having cookieless domains for static content, you can reduce the size of the request and thus getting a performance improvement for page loads.   

How to Use Either Item:

Our Linux servers already support both cookieless domains and parallel downloads on the server side via nginx.  To protect against search engines down-ranking pages because of duplicate content, no pages are served from this setup and will produce a 404 if requested.  If you have a file extension that you would like added to the list of content to be allowed on this, please let us know.  

Setup:

All you need to do is change your html files to point to the following hostnames.  How you do this depends on what you are using for your site:

Scripts (Wordpress, Joomla, etc):

Wordpress, joomla, etc have plugins such as w3 super cache that you can set to use different hostnames for different files or use the CDN settings to change.  These plugins change the location of the images without you changing anything else.   If your script does not support changing the locations via modules/plugins, then changing the theme files as if they were HTML files would need to be done -- see below for more info.

HTML / Sitestudio / Other WYSIWYG EDITOR

You will need to change each file that you want to use this setup.  For plain html, you would change the src tag to be a full URL to either the js, css, or images location.

Addresses to use for each type:

    • Javascript (JS): js.domain.com
    • Images: images.domain.com
    • CSS: css.domain.com
      • (where domain.com is your real domain)

    • You may also need to either add a wildcard DNS record or each DNS record as a CNAME record.  (see below for more info)
    • If you can not change all file types to the three above, you can point your content to static.domain.com or content.domain.com .

Note to VPS customers, new deploys of linux VPS servers will include support for this setup, however, some older VPS deploys may not have this.  If you would like this to be setup on your server, please contact us. 

CNAME / Wildcard setup:

By default our DNS records come with a wildcard record so that anything.your-domain.com would go to the same server that your domain is on.  In some cases this may have been removed or doesn't exist because of a change in the defaults.  In either case, please use the following guides to create the DNS records:

Hsphere 

  1. Login to the control panel (hsphere) and go to Domain Settings -> Domain Info and click on the domain if you have multiple --> click DNS configuration
  2. Once on the DNS configuration page, check if there is a record under the "A" record section similar to:  *.your-domain.com .
    1. If so, you are set and nothing else to do.
    2. If not, please do the following:
      1. You can either create a new wildcard record by clicking the "New A record" and putting a "*" in the name field and the IP (x.x.x.x) shown on the DNS page in to the data field
      2. Or, you can create CNAME records for each one:
        1. Click "Create new CNAME record" under the CNAME record section
        2. Put in css, images, or js in the name field and put your-domain.com (without the www) in the data field
        3. Leave all other fields as defaults and submit page
        4. Repeat for each one
If you have any suggestions to improve this or other items related to hosting, please contact us.
  • 297 Users Found This Useful
Was this answer helpful?

Related Articles

Block HTTP request based on user agent - browser used

If you need to block a user agent / bot / browser from your site, you can do so with a .htaccess...

FTP over SSL (FTPS)

Our Linux servers require SSL/TLS for FTP connections -- otherwise known as FTP over SSL. ...

openssl 1.0.1 or greater in PHP -- hsphere only

If you receive an error with your php script about "openssl 1.0.1 or greater" is required, please...

Changing Domain / Hosting Alias to Standalone Site

Hsphere has a two domain aliasing features:  Domain aliasing and service aliases. ...

PHP 5.6, 7.0 Fails to connect via SSL / TLS

Starting at PHP 5.6, PHP does a verify of the SSL certificate and if it fails to the connection...