Tech Nsavi
Wednesday, May 31, 2023
  • Home
  • Newest Inventions
    • Tech Education
  • Web Development
  • Gaming Laptop
  • Gadget
  • Crypto
  • SEO Expert
  • Drop Services
  • Make Money Online
No Result
View All Result
  • Home
  • Newest Inventions
    • Tech Education
  • Web Development
  • Gaming Laptop
  • Gadget
  • Crypto
  • SEO Expert
  • Drop Services
  • Make Money Online
No Result
View All Result
Tech Nsavi
No Result
View All Result
Home Web Development

Learn how to use Redis for Magento 2 session administration

technsavi by technsavi
May 24, 2023
in Web Development
0
Learn how to use Redis for Magento 2 session administration
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

RELATED POSTS

UI Interactions & Animations Roundup #33

Merge Objects in JavaScript — SitePoint


To make use of Redis for session administration in Magento 2, you’ll must configure Magento to make the most of Redis because the session storage backend. Right here’s a step-by-step information on the way to set it up

Set up Redis

Be sure you have Redis put in and working in your server or native setting. You’ll be able to obtain Redis from the official web site and observe the set up directions in your working system.

Configure Magento 2 to make use of Redis for session storage:

1. Log in to your Magento 2 server or entry the Magento 2 codebase.
2. Within the Magento 2 root listing, open the `app/and so forth/env.php` file.
3. Find the `session` configuration part, which ought to appear like this:

'session' => [
    'save' => 'files',
    'save_path' => 'path/to/session/files',
]

4. Substitute the ‘save‘ worth with ‘redis‘ and add a ‘redis‘ key to the ‘session‘ array with the Redis server configuration:

'session' => [
    'save' => 'redis',
    'redis' => [
        'host' => '127.0.0.1',
        'database' => '2',
        'log_level' => '4',
        'port' => '6379',
        'password' => '',
        'timeout' => '2.5',
        'persistent_identifier' => '',
        'compression_threshold' => '2048',
        'compression_library' => 'gzip',
        'max_concurrency' => '6',
        'break_after_frontend' => '5',
        'break_after_adminhtml' => '30',
        'first_lifetime' => '600',
        'bot_first_lifetime' => '60',
        'bot_lifetime' => '7200',
        'disable_locking' => '0',
        'min_lifetime' => '60',
        'max_lifetime' => '2592000',
        'sentinel_master' => '',
        'sentinel_servers' => '',
        'sentinel_connect_retries' => '5',
        'sentinel_verify_master' => '0'
    ]
]

5. Save the modifications to the `env.php` file.
Clear Magento cache: Clear the Magento cache to make sure the brand new session configuration takes impact. You are able to do this by working the next command from the Magento root listing:
php bin/magento cache: clear

Trying to find an skilled
Magento Firm ?
Learn Extra


Check session administration with Postman:

1. Open Postman or any REST API testing device.
2. Set the HTTP methodology to POST.
3. Set the URL to your Magento 2 base URL adopted by /relaxation/V1/integration/admin/token (e.g., `http://yourmagento2domain.com/relaxation/V1/integration/admin/token).
4. Within the request physique, choose
`form-data` and add the next key-value pairs:

`username`: Your Magento 2 admin username
`password`: Your Magento 2 admin password
5. Click on the “Ship” button to ship the request. This can return an entry token.
6. Copy the entry token from the response.

1. Set the HTTP methodology to GET.
2. Set the URL to your Magento 2 base URL adopted by /relaxation/V1/retailer/storeViews.
3. Add a header with the next key-value pair:

`Authorization`: Bearer [access_token]
Substitute
`[access_token]` with the entry token you obtained within the earlier step.
d. Click on the “Ship” button to ship the request. This can retrieve the shop views info.

Redis monitor command (Should you use Redis for session storage, you’ll see output much like the next)

redis-cli monitor

Session storage

redis-cli monitor
redis-cli monitor

Redis ping command

redis-cli ping

PONG must be the response.

Extra info
redis-cli command reference

That’s it! You may have now configured Redis for session administration in Magento 2 and examined it utilizing Postman. You’ll be able to proceed exploring different Magento 2 REST APIs utilizing the entry token and applicable endpoints.

author-thumb


Sushil Kumar
4 Badges

23 Could 2023



Source_link

ShareTweetPin
" data-ad-slot="">
technsavi

technsavi

Related Posts

UI Interactions & Animations Roundup #33

UI Interactions & Animations Roundup #33

by technsavi
May 30, 2023
0

Get impressed with new movement designs and inventive UI interactions in our latest roundup, showcasing the newest works from proficient...

Merge Objects in JavaScript — SitePoint

Merge Objects in JavaScript — SitePoint

by technsavi
May 30, 2023
0

Builders usually must merge or copy objects for duties like combining knowledge or creating new situations. Methods just like the...

The Influence Of Agile Methodologies On Code High quality — Smashing Journal

The Influence Of Agile Methodologies On Code High quality — Smashing Journal

by technsavi
May 30, 2023
0

Say goodbye to conventional workflows and embrace Agile to unlock the facility of high-quality code. Uncover how Agile methodologies promote...

Optimize lengthy duties

Optimize enter delay

by technsavi
May 29, 2023
0

Discover out what enter delay is, and be taught strategies to cut back it for sooner interactivity.Could 9, 2023 Interactions...

How one can improve Opencart 3  to Opencart 4

How one can improve Opencart 3  to Opencart 4

by technsavi
May 29, 2023
0

Upgrading from OpenCart 3 to OpenCart 4 is a vital step to make the most of the newest options, enhancements,...

Next Post
Which has meals elevated most in value, and why?

Which has meals elevated most in value, and why?

A Good Method for College students to Visually Evaluate the Sizes of International locations and States

A Good Method for College students to Visually Evaluate the Sizes of International locations and States

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

RECOMMENDED

Google’s Pixel Watch 2 will reportedly have considerably improved battery life

Google’s Pixel Watch 2 will reportedly have considerably improved battery life

May 31, 2023
20+ Running a blog Instruments to Enhance Your Workflow

20+ Running a blog Instruments to Enhance Your Workflow

May 30, 2023
  • 647 Followers
  • 23.8k Followers

MOST VIEWED

  • 9 Methods to Save Cash on Airbnb (+ Airbnb Coupon) 2023

    9 Methods to Save Cash on Airbnb (+ Airbnb Coupon) 2023

    0 shares
    Share 0 Tweet 0
  • The T1 Tomahawk Is the Geekiest Tape Measure Ever, and We Love It

    0 shares
    Share 0 Tweet 0
  • The Emergence of NFT Market within the Trendy Period

    0 shares
    Share 0 Tweet 0
  • 20 Finest Paid Analysis Research & Focus Teams in 2022 ($100+/hr)

    0 shares
    Share 0 Tweet 0
  • Grasp Your Graphic Design Elevator Pitch with These Suggestions & Examples

    0 shares
    Share 0 Tweet 0

Tech Nsavi

Welcome to Technsavi The goal of Technsavi is to give you the absolute best news sources for any topic! Our topics are carefully curated and constantly updated as we know the web moves fast so we try to as well.

CATEGORY

  • Crypto
  • Drop Services
  • Gadget
  • Gaming Laptop
  • Make Money Online
  • Newest Inventions
  • SEO Expert
  • Tech Education
  • Web Development

Recent Comments

    Recent News

    • Google’s Pixel Watch 2 will reportedly have considerably improved battery life
    • 20+ Running a blog Instruments to Enhance Your Workflow
    • Binance Has A Grasp Plan To Handle Crypto Threat By Letting Merchants Maintain Collateral In Banks ⋆ ZyCrypto
    • Home
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms & Conditions

    Copyright © 2022 Technsavi.com | All Rights Reserved.

    No Result
    View All Result
    • Home
    • Newest Inventions
      • Tech Education
    • Web Development
    • Gaming Laptop
    • Gadget
    • Crypto
    • SEO Expert
    • Drop Services
    • Make Money Online

    Copyright © 2022 Technsavi.com | All Rights Reserved.

    What Are Cookies
    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
    Cookie SettingsAccept All
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    SAVE & ACCEPT