wiki:Documentation/NewbieGuide/Caching

Version 2 (modified by gogo, 5 weeks ago) (diff)

--

Caching Xinha

Xinha use involves the browser loading a fairly large number of files from the web server, it is in your interest to assist the browser in not requesting these seldom changed files.

If you are running Xinha from your own server (rather than an external server, CDN etc) then you may need to tell your server to tell the browser not to check the files for changes so often. For Apache users, a set of caching directives like this in a .htaccess file (eg /path/to/xinha/.htaccess) is a good idea...

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/gif        "access plus 24 hour"
  ExpiresByType image/jpg        "access plus 24 hour"
  ExpiresByType image/jpeg       "access plus 24 hour"
  ExpiresByType image/png        "access plus 24 hour"
  ExpiresByType application/javascript       "access plus 24 hour"
  ExpiresByType text/css         "access plus 24 hour"
  ExpiresByType application/xml  "access plus 24 hour"
</IfModule>

If course you can make the time longer, or shorter, the point is your Xinha files are unlikely to change any time soon so you might as well make it cache for a long time.

If "ease of transition" is a concern (that is when you upgrade Xinha you don't want your clients to be troubled with caching) then name your xinha directory with the version, eg instead of /xinha/XinhaEasy.js have /xinha-1.5/XinhaEasy.js` then you won't have that issue will you.