Databases Reference
In-Depth Information
c.
In Notepad, open the Apache configuration file,
httpd.conf
, from the location
defined in Chapter 8, Debugging & Tools. Figure 7-3 shows the default location
on Windows 7.
Figure 7-3. Open Apache
httpd.conf
file
d.
Search the file for expires. The first result should bring you to the following
line:
#LoadModuleexpires_module modules/mod_expires.so
. Uncomment this
line by removing the hash (#) symbol.
e.
Search the file for
<IfModulecgid_module>
. Just above this line, add the
following lines:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/javascript "access plus 60 seconds"
ExpiresByType application/javascript "access plus 60 seconds"
</IfModule>
This setting will cache JavaScript files from your local web server for 60
seconds. Of course, web servers can cache files for a much longer period of
time, but this is just for demo purposes.