tags:

views:

372

answers:

5

This may sound like a stupid question, perhaps it is. But I'm only trying to make sure there's no secret information hiding from me.

Alright, so if I have the option of putting in extra effort to develop in plain html and hook up my back-end via ajax, do I go for it?

Meaning, I could use PHP/JSP to include files such as headers, footers and navigation. This processing takes place upon user request for the file.

But alternatively, I can use an ant build script to compile an HTML file from headers, footers, navigation, etc upon release. But that takes some effort.

Keep in mind, that this is not an AJAX v/s non-AJAX question and resultant output file in both cases is the same, except for the file extensions.

+3  A: 

'Plain HTML' and server-generated HTML should be identical. You can also use server handlers to make, for example, querystrings behave in an 'SEO friendly' manner.

Rushyo
A: 

HTML static pages are slightly faster than server generated ones and speed is a factor in SEO however not a significant one.

Alix Axel
+1  A: 

An HTML and javascript page that uses AJAX to display the content actually decreases your search engine visibility as the spidering search engine isn't going to bother to interpret your javascript. The search engine won't see any of your content.

Fortunately, most search engines understand RSS or ATOM so be sure to include a news feed with your site.

Glenn
+5  A: 

The document extension (*.html / *.php / *.aspx) makes no difference at all for your search engine ranking. If we leave out the page content for a moment, what matters with regards to URLs is:

  • a logical and consistent URL structure, ideally a tree structure.
  • using the right keywords in your URLs, separated by dashes.
  • if possible avoid using query strings "?" in your URLs (getting less important, but still valid for the smaller search engines)
  • the overall 'crawlability' of your site (having a XML sitemap, having plain-text links to all pages on the site, proper use of a robots.txt exclusions)

You can easily 'hide' the file extension type somewhat on almost all systems, by doing something like www.acme.com/mycms.php/pagename/ and then have mycms.php parse the requested URL.

Good modern web frameworks will allow you full control of your URL structure, examples are Django and ASP.NET MVC.

One thing that is hard is localization. There are many suggestions:

  • use a separate site for each language (acme.com / acme.co.uk / acme.de / acme.ch )
  • use a separate subdomain (en.acme.com / de.acme.com )
  • use a extension www.acme.com/pagename.en.html
  • use a root 'folder' www.acme.com/en/pagename

I think I have settled on the 'root folder' approach for now, but there are good arguments for the other approaches too.

For an example of a good URL structure, take a look at this very site. :-)

Jesper Mortensen
A: 

I think choosing to display generated HTML over server-made HTML could be a good idea in some scenarios, specially if you do it through an automated script: -

  • When you don't have to load any data from the server from a database.
  • When the pages are not going to change frequently, and not in response to user interaction.
  • When you want to save precious seconds (the time that the processing script will take to generate the HTML)

But to be honest today using some kind of server scripting has become almost imperative if you want to build a popular website. That's because website specs and requirements are changing fast and new requirements are often implemented easiest and fastest using server scripting.

So I think you're best invested if you choose server scripting (Any PHP/ASP/JSP) to serve your data.

Now about Ajax, I don't know how you can make this work very well without server scripting, unless your active content is retrieved from static html content too.

If you're going to involve databases, you're going to require scripting.

Cyril Gupta