JavaScript (and consequently AJAX) is a tool that can either be used to enhance a website, or abused to crud it up. As Perl culture, I think it we have a history of being open to all the tools at our disposal. Those dismissing AJAX out of hand because it's a 'fad' or requires JavaScript IMO are short sighted.

As to whether pm could use a little AJAX, I have no opinion, but the areas you suggested for enhancement don't strike me as providing any solid benefit. Server load is made up of more than just data retrieval and page creation. There's also session management and data verification which must occur regardless of how many bytes are returned.

Voting for example, still needs to verify the user session, and validate the node being voted on and retrieve the new vote count. This could add up to nearly the equivalent server load of the existing method or rendering the entire site view. Then you'd have to make additional AJAX calls to update all the other bits that come with the entire site view (cb, messages, xp). So now you've split one request, with one overhead, into several requests, each adding their own overhead. Now factor in that you can vote for several nodes in a single request without AJAX, but you have to make a new request for each vote with AJAX and you've multiplied the server load many times over yet again.

The most obvious reason to use AJAX is to enhance the user experience with a seamless 'non-refreshing' website and I think this should be the fundamental point. Arguing for AJAX based on sever load is a red herring IMO.


In reply to Re: AJAX to reduce server load by ruzam
in thread AJAX to reduce server load by bellaire

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.