AddType directive:
"While some users prefer to use PHP in conjunction with the .html extension, keep in mind that doing so
will ultimately cause the file to be passed to PHP for parsing every single time an HTML file is requested.Some
people may consider this convenient, but it will come at the cost of performance." can't catch up with this paragraph. supposeed a file's suffix is .html,there is no php in it. does it to be passed to PHP for parsing ?
php AddType directive
Moderator: General Moderators
-
everydayrun
- Forum Commoner
- Posts: 51
- Joined: Wed Jan 20, 2010 1:30 am
Re: php AddType directive
anyone helps?
Re: php AddType directive
If there's no PHP then there's no point making PHP try to run it. In fact, it's worse than letting Apache handle it automatically.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: php AddType directive
Although the question was already answered, let me just follow up with a more clear response.everydayrun wrote:can't catch up with this paragraph. supposeed a file's suffix is .html,there is no php in it. does it to be passed to PHP for parsing ?
If you add .html suffix to to the AddType directive, any and all html files will be interpreted by the PHP engine. Even with the default .php extension, even if there is no PHP code found within the file, it is still interpreted as a PHP file. As such, even though the files will be parsed by PHP, only code within the PHP tags are actually evaluated.
However, I would not consider this a great performance drain (unless you either have extremely high volume of traffic, where you would benefit from caching).