Ajax応答から動的に画像を取得するための大きなデータベースがあります。どうすればそれを超高速にすることができますか
画像は、次のようなカンマ区切り形式です
img4.jpg、img3.jpg、img5.jpg、img7.jpg、img11.jpg、img1.jpg、img2.jpg、img3.jpg、img6.jpg、img8.jpg
phpの私のコード。
function childImgsGrid(){
$parentImgId = $_POST['parentImgId'];
$query = mysql_query("select child_imgs_id,child_imgs from parent where parent_img_id = $parentImgId")
or die(mysql_error());
$result = mysql_fetch_array($query);
$arrayOfImages = explode(",", $result['child_imgs']);
$i=1;
foreach($arrayOfImages as $nameOfImage){
echo "<li><a href='#lookbook' ><div class='view'><img src='images/slide/".$nameOfImage."'></a></li>";
}
}
とAjaxの場合
var parentImgId = $anchor.attr("id");
var dataString = 'queryString=childImgsGrid'+'&parentImgId='+parentImgId;
var arrayOfImages = new Array();
$glob.ajax({
type: "POST",
url: "ajaxtemplate.php",
data: dataString,
cache: false,
success: function(response) {
$glob('#grid').html(response);
}
});