2

just a question from curiosity. How big online stores with lots of products (can) store their product pages?

I know one solution might be database and then generating the content on demand, but how would they be able to hand URL requests like www.onlinestore.com/productname.htm? (Specificaly I mean this store http://www.alza.cz/pevne-disky/18842851.htm ). Every product links to productname.htm page.

Is it possible (and viable) to have all product pages pregenerated?

royhowie
  • 11,075
  • 14
  • 50
  • 67
Lukáš Řádek
  • 1,273
  • 1
  • 11
  • 23
  • 1
    They are most likely using a wildcard routing engine to map .htm to a specific product in their catalog. The server is likely running a dynamic language like PHP or ASP.NET to handle requests. – Nathan Taylor Jan 30 '15 at 22:16
  • 1
    This can be done with URL rewriting, routing or slugging, for example. Pregenerating is not a good solution, as caching can achieve the same performance benefits and is much simpler to implement. – Ortiga Jan 30 '15 at 22:18
  • @NathanTaylor so (with my knowledge limited to html,php,js,sql and "htaccess" :)... can I IMAGINE it like handling URL request with htaccess and redirecting to something like generateproductpage.php?product=productname and then let PHP pull data from DB? – Lukáš Řádek Jan 30 '15 at 22:21
  • @LukášŘádek That's exactly correct. – Nathan Taylor Jan 30 '15 at 22:22

1 Answers1

0

The answer will vary from vendor to vendor, but typically this is achieved with a combination of custom URL routing, and a server-side, database-driven language like ASP.NET or PHP.

In the case of your example, it is likely that the "18842851" of http://www.alza.cz/pevne-disky/18842851.htm is actually a product Id, and their server is parsing that product Id in order to get the correct product content from a database. With the content in-hand, the server can then return a reusable template.

Nathan Taylor
  • 24,423
  • 19
  • 99
  • 156