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