Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE HTML>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Compile &amp; Debug - Google Web Toolkit - Google Code</title>
<script type="text/javascript"><!--
(function(){function a(){this.t={};this.tick=function(c){this.t[c]=(new Date).getTime()};this.tick("start")}var b=new a;window.jstiming={Timer:a,load:b};if(window.external&&window.external.pageT)window.jstiming.pt=window.external.pageT;})();

var _tocPath_ = '/webtoolkit/_doc_toc.ezt';
var codesite_token = null;
var logged_in_user_email = null;
//--></script>
<link href="GWTdev_files/codesite.css" type="text/css" rel="stylesheet">
<script src="GWTdev_files/codesite_head.js" type="text/javascript"></script>
<script type="text/javascript">CODESITE_CSITimer['load'].tick('bhs');</script>
<link rel="search" type="application/opensearchdescription+xml"
title="Google Code" href="http://code.google.com/osd.xml">

<!--[if IE]><link rel="stylesheet" type="text/css" href="/css/iehacks.css"><![endif]-->

    <link href="GWTdev_files/semantic_headers.css" rel="stylesheet"
type="text/css">
    <link rel="stylesheet" href="GWTdev_files/local_extensions.css"
type="text/css">

  <script src="GWTdev_files/ga.js" async="" type="text/javascript"></script><script src="GWTdev_files/googleapis.js"></script></head><body
 class="gc-documentation">




    <script type="text/javascript">
var _gaq = _gaq || [];

var cookiePath = '/webtoolkit/';
if (cookiePath.lastIndexOf('.html') > cookiePath.lastIndexOf('/')) {
  cookiePath = cookiePath.substring(0, cookiePath.lastIndexOf('/') + 1);
};

_gaq.push(


    ['projectTracker._setAccount', 'UA-18071-28'],
    ['projectTracker._setDomainName', 'code.google.com'],
    ['projectTracker._setCookiePath', cookiePath],
    ['projectTracker._trackPageview'],

    ['siteTracker._setAccount', 'UA-18071-1'],
    ['siteTracker._setDomainName', 'code.google.com'],
    ['siteTracker._setCookiePath', cookiePath],
    ['siteTracker._trackPageview']
);
(function() {
  var ga = document.createElement('script');
  ga.type = 'text/javascript';
  ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  (document.getElementsByTagName('head')[0] ||
   document.getElementsByTagName('body')[0]).appendChild(ga);
 })();
</script>

<h3 id="perfect_caching">Perfect Caching</h3>

<p>Among other optimization and performance improvement techniques, GWT
also offers the concept of "Perfect Caching", which you can take
advantage of if you deploy your application correctly.</p>

<p>You may have noticed that the bootstrap script filename contains a <code>.nocache.js</code>
 suffix, whereas the rest of the GWT application files contain a <code>.cache.html</code>
 suffix. These are meant as indicators that you can use to configure
your web server to implement perfect caching. The bootstrap script is
named after a well-known application name (<code>&lt;app_name&gt;.nocache.js</code>),
 while the GWT application files all contain md5 sums in their names.
Those md5 sums are computed from your GWT codebase at the time of
compilation. The bootstrap script contains a lookup table that selects
the right <code>&lt;md5&gt;.cache.html</code> file when your client
first visits your site and loads up your GWT application. The bootstrap
process is explained in greater detail <a
href="http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideBootstrap">here</a>.</p>

<p>The fact that the application filenames will always change if your
codebase changes means that your clients can safely cache these
resources and don't need to refetch the GWT application files each time
they visit your site. The resource that should never be completely
cached (an If-Modified-Since fetch is sufficient and saves bandwidth) is
 the bootstrap script, since it contains the logic necessary to lookup
the correct application file. If you were to configure these rules on an
 Apache HTTP server, you might get something like this in your <code>.htaccess</code>
 config file, using both mod_expires and mod_headers:</p>

<pre class="prettyprint"><span class="tag">&lt;Files</span><span class="pln"> *.</span><span class="atn">nocache</span><span class="pln">.*</span><span class="tag">&gt;</span><span class="pln"><br>&nbsp; ExpiresActive on<br>&nbsp; ExpiresDefault "now"<br>&nbsp; Header merge Cache-Control "public, max-age=0, must-revalidate"<br></span><span class="tag">&lt;/Files&gt;</span><span class="pln"><br><br></span><span class="tag">&lt;Files</span><span class="pln"> *.</span><span class="atn">cache</span><span class="pln">.*</span><span class="tag">&gt;</span><span class="pln"><br>&nbsp; ExpiresActive on<br>&nbsp; ExpiresDefault "now plus 1 year"<br></span><span class="tag">&lt;/Files&gt;</span></pre>

</body></html>

Commits for litesoft/trunk/Documents/ScarVersioningCaching/06.html

Diff revisions: vs.
Revision Author Commited Message
415 Diff Diff GeorgeS picture GeorgeS Thu 18 Aug, 2011 13:52:09 +0000
414 GeorgeS picture GeorgeS Thu 18 Aug, 2011 05:03:45 +0000