5 Replies Latest reply on Sep 22, 2008 9:52 AM by Ross

    Huge ajax responses??

    Dustin Norlander Apprentice

      I have noticed that all of my ajax4jst forms have a jsf_state_64 and a jsf_tree_64 input fields that have values 2000+ characters long. Is this really necessary? I have also looked at the responses from simple ajax updates and they are HUGE, filled with random strings of characters, I could do a page reload at that kind of cost. Is there any work being done to streamline these form values and the ajax responses, or is there something i'm missing?

      thanks
      Dustin

        • 1. Re: Huge ajax responses??
          Igor Shabalov Apprentice

          You probably have client state saving method. What version of JSF you are in?

          • 2. Re: Huge ajax responses??
            Dustin Norlander Apprentice

            You are exactly right. thanks!

            Setting

            <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>server</param-value>
             </context-param>
            

            in web.xml changed it.

            On thing though, why does each request have to include all the javascript sources?

            <?xml version="1.0"?>
            
            <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link type="text/css" rel="stylesheet"
            
             href="/IF3-Site/a4j.res/org/richfaces/renderkit/html/css/dragIndicator.xcss/DATA/eAGz-yBjAQAEPAGD
            
            .seam" /><link type="text/css" rel="stylesheet" href="/IF3-Site/a4j.res/org/richfaces/renderkit
            
            /html/css/tree.xcss/DATA/eAGz-yBjAQAEPAGD.seam" /><script type="text/javascript" src="/IF3-Site
            
            /a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/prototype.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /json/json.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/dnd.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /dnd/dnd-draggable.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /dnd/dnd-dropzone.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/ajax4jsf/framework/ajax/scripts
            
            /AJAX.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/ajax4jsf/renderkit/html/scripts
            
            /form.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /events.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /tree.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /tree-selection.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /tree-item.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /tree-item-dnd.js.seam">
            
            </script><script type="text/javascript" src="/IF3-Site/a4j.res/org/richfaces/renderkit/html/scripts
            
            /drag-indicator.js.seam">
            
            </script></head><body><span id="dynamicUpdate"><label>AJAX POSTED! 0</label> <script type="text/javascript"
            
            >//<![CDATA[
            
             i++;
            
            
            
            //
            
            //]]>
            
            </script></span><div xmlns:rich="http://richfaces.ajax4jsf.org/rich"></div><meta name="Ajax-Update-Ids"
            
             content="dynamicUpdate" /><span id="ajax-update-ids"><input type="hidden" name="jsf_sequence" value
            
            ="2" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
            


            • 3. Re: Huge ajax responses??
              Sergey Smirnov Master

              Javascripts files are cached. So, this does not impact the traffic

              • 4. Re: Huge ajax responses??
                Michal Nikodim Newbie

                 

                "SergeySmirnov" wrote:
                Javascripts files are cached. So, this does not impact the traffic


                ...but then i have on simply ajax request about 5.2kB size response. Without javascript in response (in html header) could i have response size about 1kB. This is good for you ?

                Can i cut off head section from ajax response anyway?

                • 5. Re: Huge ajax responses??
                  Ross Newbie

                   

                  ...but then i have on simply ajax request about 5.2kB size response. Without javascript in response (in html header) could i have response size about 1kB. This is good for you ?

                  Can i cut off head section from ajax response anyway?


                  I noticed this as well. On an AJAX request everything in my HTML head section returns back in the AJAX response.

                  Why does it do this?

                  I also noticed if you have plain HTML it also returns back in the response. But if you enclose the plain HTML in a f:verbatim tag than it isn't returned.

                  Even though the response is still relatively small is it possible to not return it?

                  I checked the demo site and I notice the HTML head sections returned from an AJAX request are empty.