I'm trying to get config values using:


& it returns the cached value.
Is there any way to make it skip the cache without disabling it?
*I want the cache to be enabled but still bypass it for this value only.
**I also don't want to always clear the cache programmatically before getting it.
-- Any idea?


1 Answer 1


you can use below code to get system config value even if caching is enable.

namespace Vendor\Extension\Helper;

use Magento\Framework\App\Helper\Context;

class Data extends AbstractHelper
    private $configCollection;

    public function __construct(Context $context,
                                \Magento\Config\Model\ResourceModel\Config\Data\CollectionFactory $configCollection)
        $this->configCollection = $configCollection;
    public function getFieldValue()
        $collection = $this->configCollection->create();
            return $collection->getFirstItem()->getData()['value'];
            return "";



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.