Chapter Two Review
Q: What is a bootstrap file?
A: A default setting all encompassing auto load file for your site/project. Gets constants defined, sets the stage for debugging and may include functions used by all pages. Can also point to a db connection file that would ideally be below the public site root.
Q: Why is it important that all user requests go through the bootstrap file (i.e., why shouldn’t the individual modules be accessed directly)?
A: Quicker, and possibly more secure.
Q: What two files are used to configure how the Apache Web server runs? How do the two files differ?
A: http.conf is the "master settings" file - and it can also include other files. Then, if allowed by this http.conf file, htaccess files can also control apache behavior.
Q: How can you test if mod_rewrite is available to use within a specific directory?
A: Throw a syntax error at it - see if you get a 500 error.
A: Mod_rewrite works from a definition of the site root and thus cannot respond to relative paths.
Q: What is caching? Why is caching useful? When can caching be problematic?
A: Caching is the temporary storing of a page or data in memory instead of pulling a "live" request from the server. Time sensitive information that is cached for too long can be a problem.
Q: What PHP function can be used to affect the caching of a page?
A: The header functions can set all sorts of nifty values for max time, expiration etc.