| @@ 305-319 (lines=15) @@ | ||
| 302 | * |
|
| 303 | * @return string |
|
| 304 | */ |
|
| 305 | protected function _getDefaultBackend() { |
|
| 306 | $timeout = Mage::getStoreConfig('turpentine_vcl/backend/frontend_timeout'); |
|
| 307 | $default_options = array( |
|
| 308 | 'first_byte_timeout' => $timeout.'s', |
|
| 309 | 'between_bytes_timeout' => $timeout.'s', |
|
| 310 | ); |
|
| 311 | if (Mage::getStoreConfig('turpentine_vcl/backend/load_balancing') != 'no') { |
|
| 312 | return $this->_vcl_director('default', $default_options); |
|
| 313 | } else { |
|
| 314 | return $this->_vcl_backend('default', |
|
| 315 | Mage::getStoreConfig('turpentine_vcl/backend/backend_host'), |
|
| 316 | Mage::getStoreConfig('turpentine_vcl/backend/backend_port'), |
|
| 317 | $default_options); |
|
| 318 | } |
|
| 319 | } |
|
| 320 | ||
| 321 | /** |
|
| 322 | * Get the admin backend configuration string |
|
| @@ 326-340 (lines=15) @@ | ||
| 323 | * |
|
| 324 | * @return string |
|
| 325 | */ |
|
| 326 | protected function _getAdminBackend() { |
|
| 327 | $timeout = Mage::getStoreConfig('turpentine_vcl/backend/admin_timeout'); |
|
| 328 | $admin_options = array( |
|
| 329 | 'first_byte_timeout' => $timeout.'s', |
|
| 330 | 'between_bytes_timeout' => $timeout.'s', |
|
| 331 | ); |
|
| 332 | if (Mage::getStoreConfig('turpentine_vcl/backend/load_balancing') != 'no') { |
|
| 333 | return $this->_vcl_director('admin', $admin_options); |
|
| 334 | } else { |
|
| 335 | return $this->_vcl_backend('admin', |
|
| 336 | Mage::getStoreConfig('turpentine_vcl/backend/backend_host'), |
|
| 337 | Mage::getStoreConfig('turpentine_vcl/backend/backend_port'), |
|
| 338 | $admin_options); |
|
| 339 | } |
|
| 340 | } |
|
| 341 | ||
| 342 | /** |
|
| 343 | * Get the grace period for vcl_fetch |
|