Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
You add 2 defines in root config.php
Code: Select all
// SEO
// cache seo keywords in constant by one query in startup
define('USE_SEO_CACHE', true);
// additionally, store the seo keywords cache in file (might actually slow things down, reading cache file vs query)
define('USE_SEO_CACHE_FILE', false);
Code: Select all
// OpenBay Pro
$this->registry->set('openbay', new Openbay($this->registry));
Code: Select all
// SEO CACHE if seo urls enabled and seo cache enabled
if ($this->config->get('config_seo_url') && USE_SEO_CACHE) {
$pairs = false;
// define cache storage by store and language
$seo_pair_cache_file = 'seo.'.$this->config->get('config_store_id').'.'.$this->config->get('config_language_id');
// read cache storage if enabled
if (USE_SEO_CACHE_FILE) $pairs = $this->cache->get($seo_pair_cache_file);
// if no storage or no storage enabled fetch all seo query/keyword pairs for store and language
if (!$pairs) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "' order by keyword ASC ");
$pairs = array();
// build query/keyword pairs
foreach ($query->rows as $row) $pairs[$row['query']] = $row['keyword'];
// store the pairs in file if enabled
if (USE_SEO_CACHE_FILE) $this->cache->set($seo_pair_cache_file, $pairs);
// free memory
unset ($query);
}
// define the pair constant
global $seo_pairs;
$seo_pairs = $pairs;
// free memory
unset($pairs);
}
Code: Select all
public function rewrite($link) {
Code: Select all
global $seo_pairs;
Code: Select all
foreach ($data as $key => $value) {
if (isset($data['route'])) {
if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
}
} elseif ($key == 'path') {
$categories = explode('_', $value);
foreach ($categories as $category) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'category_id=" . (int)$category . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
} else {
$url = '';
break;
}
}
unset($data[$key]);
}
}
}
Code: Select all
foreach ($data as $key => $value) {
if (isset($data['route'])) {
if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id')) {
if (USE_SEO_CACHE && $seo_pairs) {
if (isset($seo_pairs[$key . '=' . $value])) {
$url .= '/' . $seo_pairs[$key . '=' . $value];
unset($data[$key]);
}
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
}
}
} elseif ($key == 'path') {
$categories = explode('_', $value);
foreach ($categories as $category) {
if (USE_SEO_CACHE && $seo_pairs) {
if (isset($seo_pairs['category_id=' . $category])) {
$url .= '/' . $seo_pairs['category_id=' . $category];
unset($data[$key]);
} else {
$url = '';
break;
}
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'category_id=" . (int)$category . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
} else {
$url = '';
break;
}
}
}
unset($data[$key]);
}
}
}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Code: Select all
define('USE_SEO_CACHE_FILE', true);
for example:
admin/model/catalog/product.php
after:
Code: Select all
$this->cache->delete('product');
Code: Select all
$this->cache->delete('seo');
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
The problem happened again even with disabling SEO URL and category count and before usingt seo cache, I will see tomorrow what will happen.
It seems I should move to another host. I asked byet.host about max_questions limit on there plans and what is the best plan according to my site traffic, they replied :
They didn't mention the max_questions value for each plan. Do you think I should know the max_questions value before moving to that host or things will be fine, I didn't understand all plan details like (EP) :25 - i/o (kbps) 6096?Please see below the details :
Super premium CPU units: 200 CPU cores: 2 - RAM: 1024 MB Concurrent processes (EP) :22 - i/o (kbps) 6096
Ultimate premium CPU units: 800 CPU cores: 3 - RAM: 1024 MB Concurrent processes (EP) :25 - i/o (kbps) 6096
Business Hosting Standard CPU units: 800 CPU cores: 3 - RAM: 1024 MB Concurrent processes (EP) :35 - i/o (kbps) 10000
The VPS servers are measured differently and cant be compared, based on your traffic our ultimate plan should be perfect for your site I see no reason why it would not run great at iFastNet.
Regards,
I am not sure about what hosting to use, I don't use hosting so I have no limits, just the physical ones.
The CPU and I/O numbers are meaningless to the average user who has no way of knowing what is required there to make their eCommerce site perform.
The real important items are the commercial policies they set themselves like database max connections and/or questions aside from their support quality of course.
max_questions means the limit they set on the number of queries a user can execute within a specific timeframe so I would demand an answer on that.
If they cannot answer that, move on.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: Semrush [Bot] and 69 guests