Imagine we have a page with a form where users can create their own discussion forum by inserting some data. Inside each forum anyone will be able to post different threads and topics.
Scenario 1:
Use PHP to create a new HTML file every time a user creates his own forum. This would lead to hundreds maybe thousands of different html files.
Scenario 2:
We only have one html file in which contents change depending on the ID received (so it will display the contents for “discussion1”, “discussion2” or any other discussion depending on the variable ID). This would mean having just one HTML file but a huge table in our SQL server.
I have seen examples of both scenarios for very large websites. For example, Wikipedia uses Scenario 1 while I believe other more dynamic websites use Scenario 2. What are the main pros & cons of each scenario?
I would love to know the pros & cons that matter most and also the ones related with:
– SEO
– Server response time & server load
– Site maintenance
– User experience (for bookmarks assume the ID is sent via the GET method)
Scenario 2 is certainly the way to go, keeping pages dynamic allows for editing far less files and means everything will always be the same.
With good MySQL tables and relationships the queries to the database shouldn’t be that server heavy and your site will still perform a lot better than with hundreds of .html files.
I don’t think many, if any sites use scenario 1, they will just .htaccess to alter the url and make them look like .html pages.