| @@ 328-342 (lines=15) @@ | ||
| 325 | * |
|
| 326 | * @return string |
|
| 327 | */ |
|
| 328 | protected function _getDefaultBackend() { |
|
| 329 | $timeout = Mage::getStoreConfig('turpentine_vcl/backend/frontend_timeout'); |
|
| 330 | $default_options = array( |
|
| 331 | 'first_byte_timeout' => $timeout.'s', |
|
| 332 | 'between_bytes_timeout' => $timeout.'s', |
|
| 333 | ); |
|
| 334 | if (Mage::getStoreConfig('turpentine_vcl/backend/load_balancing') != 'no') { |
|
| 335 | return $this->_vcl_director('default', $default_options); |
|
| 336 | } else { |
|
| 337 | return $this->_vcl_backend('default', |
|
| 338 | Mage::getStoreConfig('turpentine_vcl/backend/backend_host'), |
|
| 339 | Mage::getStoreConfig('turpentine_vcl/backend/backend_port'), |
|
| 340 | $default_options); |
|
| 341 | } |
|
| 342 | } |
|
| 343 | ||
| 344 | /** |
|
| 345 | * Get the admin backend configuration string |
|
| @@ 349-363 (lines=15) @@ | ||
| 346 | * |
|
| 347 | * @return string |
|
| 348 | */ |
|
| 349 | protected function _getAdminBackend() { |
|
| 350 | $timeout = Mage::getStoreConfig('turpentine_vcl/backend/admin_timeout'); |
|
| 351 | $admin_options = array( |
|
| 352 | 'first_byte_timeout' => $timeout.'s', |
|
| 353 | 'between_bytes_timeout' => $timeout.'s', |
|
| 354 | ); |
|
| 355 | if (Mage::getStoreConfig('turpentine_vcl/backend/load_balancing') != 'no') { |
|
| 356 | return $this->_vcl_director('admin', $admin_options); |
|
| 357 | } else { |
|
| 358 | return $this->_vcl_backend('admin', |
|
| 359 | Mage::getStoreConfig('turpentine_vcl/backend/backend_host'), |
|
| 360 | Mage::getStoreConfig('turpentine_vcl/backend/backend_port'), |
|
| 361 | $admin_options); |
|
| 362 | } |
|
| 363 | } |
|
| 364 | ||
| 365 | /** |
|
| 366 | * Get the grace period for vcl_fetch |
|