Databases Reference
In-Depth Information
Figure 7-11. JavaScript console network information for page reload
Figure 7-12. JavaScript console network timeline for page reload
You can now see that using a cached file can create some issues, since the client's browser may not
be using the current version of a file on your web server. By no means is it a bad thing to have cached
files (it's actually a very good thing), but you need to be aware of its impact on your plug-ins that use
external files.
The way to get around this is pretty simple. If you use a unique file name for each change that is
made to an external file, the browser will consider it as a new file and always retrieve it (at least once)
from the server.
The easiest way to ensure a unique file name is to add a suffix to the filename with a version number
and increase that version number for each change. The following steps demonstrate how to simply do
this working from the previous example.
Make a copy of apressDemo.js and call it apressDemo2.js . By making a copy of the
file, you ensure that any old apps that reference the old version still work.
Edit Page 50 (see Figure 7-8) and go to the HTML Header and Body Attribute section.
Change the file name from apressDemo.js to apressDemo2.js as shown in Figure
7-13.
 
Search WWH ::




Custom Search