When sending data using ajax, data is lost

I am working on a project where I developed a travel website. Everything is getting better and more traffic is being created. The problem is the slow generated price tags. My clients and I realized that memcache should do the trick due to the tools available. Exit, since I had to start, I rewrote the old ajax code with the new jQuery ajax code. Some other posts from this evening cover this topic a bit.

Now I have the following code that shows the price for a specific month:

function ShowPriceTable(targetElement, accommodationID, month)
{
    $.ajax({
        type:   "POST",
        url:    basePath + "/ajax/GetPriceTable.php",
        data:   "accommodationID="+accommodationID+"&month="+month,
        success: function(data){
            $("#"+targetElement).html(data);

            $.ajax({
                type:   "POST",
                url:    basePath + "/ajax/WriteCache.php",
                data:   "accommodationID="+accommodationID+"&month="+month+"&data="+data,
            });
        }
    });         
}

GetPriceTable.php - , , pricecalculation. HTML- . , data, innerHTML div, targetElement, .

, .. data, WriteCache.php . memcache $cache->set("my_key", $_POST["data"]); ( , "" ).

... , , 4067 . , . ... , alert of data.length , , 98,858.

- , ? , ? Memcache chunk_size, ​​ 8192 (, ?, doen't tell..)

!

!

P.s. memcached memcache, .

memcache. - , . HTML, - ( ), ( : ) DIV, 'mangled' output...

+5
2

, , ... HTML. . HTML , , $_GET, $_POST $_REQUEST. escape(data) . , , !

+1

MEMCACHE_COMPRESSED php.ini set a la Memcache::set($key, $var, MEMCACHE_COMPRESSED); .

0

All Articles