如何禁用部分页面的缓存?有一个动态更新的块,但我似乎无法禁用其缓存...模块与反馈和当ceche启用反馈停止显示随机... 也许我在整页缓存机制中缺少一些东西? 请帮忙。
控制器:
$this->load->model('catalog/review');
$current_store = $this->config->get('config_store_id');
$feedbacks = $this->model_catalog_review->getFeedbacksByStore($current_store);
$this->data['feedbackscrazys'][] = array(
'feedback_name' => $feedbacks['form_name'],
'feedback_text' => $feedbacks['feedback']
);
$this->response->setOutput($this->render());
模特:
public function getFeedbacksByStore($id) {
$sql = "SELECT * FROM " . DB_PREFIX . "feedbackcrazy";
$sql .= " WHERE shop_id = ".$id." AND show_index=1";
$sql .= " ORDER BY shop_id asc";
$query = $this->db->query($sql);
return $query->row;
}
和index.php
<div class="col-md-53 col-sm-55 col-xs-55 all-paddtop18">
<div class="contentItem">
<div id="footerfeedback" class="group">
<div id="footerfeedbackContentBox">
<div id="footerfeedbackTitle">
<span id="footerfeedbackYourWord">YOUR</span>
<span id="footerfeedbackOpinionsWord">FEEDBACK</span>
</div>
<div id="footerfeedbackContent" class="group">
<div id="footerfeedbackItem">
<div id="footerfeedbackItemContent">
...
</div>
<div id="footerfeedbackItemDivider">-</div>
<div id="footerfeedbackItemCustomer">...</div>
</div>
</div>
</div>
<div id="footerfeedbackShareButton">
<a href="feedback">Share your opinion</a>
</div>
</div>
</div>
</div>
的javascript:
$(document).ready(function() {
var feedbacks = function() {
for ( var i = 0; i < complex.length; i++ ) {
var name = complex[i]['feedback_name'];
var desc = complex[i]['feedback_text'];
}
var i = 0;
var fnchange = function() {
$('#footerfeedbackItemContent').animate({'opacity': 0}, 2000, function () {
$(this).text(desc);
}).animate({'opacity': 1}, 2500);
$('#footerfeedbackItemCustomer').animate({'opacity': 0}, 2000, function () {
$(this).text(name);
}).animate({'opacity': 1}, 2500);
if( ++i < json.length ){
setTimeout(fnchange, 10000);
} else {
i = 0;
setTimeout(fnchange, 10000);
}
};
setTimeout(fnchange, 1);
};
setTimeout(feedbacks,1);
});