慢速内容从xampp远程访问下载

时间:2017-11-22 02:50:00

标签: php ajax apache datatable xampp

我在Centos上安装了xampp,当我运行本地时很好,速度不到2秒,但是当我远程访问时,内容下载响应需要9秒或更长时间。 enter image description here 为什么这个可行? [![在此处输入图片说明] [2]] [2] 我在ajax请求中显示数据表:

$('#example123').DataTable({
        data: dat,
        "aLengthMenu": [
            [10, 25, 50, -1],
            [5, 15, 20, "All"]
        ],
        // set the initial value
        "iDisplayLength": 5,
        "sDom": "Rlfrtip",
        bFilter: true,
        deferRender: true,
        "bDestroy": true,         
        dataType: 'json',
        "columns": [
        { "data": null,"width": "1%", 'visible':false },
        { "data": "Articulo.cod_fa","width": "5%" },
        { "data": "Articulo.autor","width": "10%" },            
        { "data": "Articulo.descripcion","width": "35%" },
        { "data": "Articulo.edicion","width": "5%", },            
        { "data": "Articulo.año","width": "5%" },
        { "data": "Articulo.editorial","width": "10%" },
        { "data": "Grupo.descripcion","width": "10%" }
        }
        ],    

        "oLanguage": {
            "sInfo": 'Mostrando _START_ a _END_ de _TOTAL_ registros.',
            "sLengthMenu": "_MENU_ registros por pag.",
            "oPaginate": {
                "sPrevious": "Prev",
                "sNext": "Next"
            }
        }        
    });

如何让我的请求在本地运行的同时运行,请帮帮我。

    public function index() {
    $this->Articulo->recursive = 0;
    $alldata = $this->Articulo->find('all'
                ,array('conditions'=>array('Articulo.id !='=>array(0/*,2,4,2904,2905*/))
                //,'fields'=>array('Articulo.id','Articulo.cod_fa','Articulo.descripcion','Articulo.autor','Articulo.edicion','Articulo.año'
                    //,'Articulo.precio1')
                    ));     
    $dat=json_encode($alldata);     
    $this->set('articulos', $dat);
    //$this->set('articulos1', $alldata);
    $this->layout = "articulos";                                
}

这是我的控制器脚本。

0 个答案:

没有答案