当我清空“图像缓存”时
我运行这个脚本:
<?php
apc_clear_cache();
require '../app/Mage.php';
function getImages($store){
Mage::app()->setCurrentStore($store);
$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect('name');
foreach($products as $product) {
echo 'product: '.$product->name.' IMAGE: '.$product->getImageUrl().'<br>';
}
}
foreach (Mage::app()->getWebsites() as $website) {
echo $website;
foreach ($website->getGroups() as $group) {
$stores = $group->getStores();
foreach ($stores as $store) {
getImages($store);
}
}
}
echo 'done';
我想要的是缓存中的所有图像都会刷新,但它们不会(仅当我在浏览器中加载 url 时)
我怎样才能做到这一点?