What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Good morning all, we have a feature that needs to make a Zed request from Yves _after_ Yves has sent
Good morning all, we have a feature that needs to make a Zed request from Yves after Yves has sent the response. We do this so Yves TTFB is not effected by the Zed call. In the Spryker silex days we used the Silex finally
hook and this worked well. For the latest version of Spryker we switch to using the KernelEvents::TERMINATE
in a EventDispatcherPlugin
. This does not work anymore as the session is now closed (in the KernelEvents::RESPONSE
event), so the Zed call does not have access to currency, locale, etc.
We have a workaround to prevent the session closing in the KernelEvents::RESPONSE
but not 100% sure if this is safe or future-proof. Has anyone got recommendations for this type of feature?
Comments
-
Im not sure such solution would meet your requirements, but you could call zed in order to add an event to queue.
This way you are not waiting for any operations Zed would perform
But you still have to wait for Zed response,
Don't know if this works for you0 -
Yes that would work, but it would still make a Zed request before the Yves response is sent so could still add ~100ms to TTFB. So ideally we want to make this Zed call invisible to customers π
0 -
Hey Rick, could you elaborate a bit more about your use case - what are you trying to achieve by calling Zed after Yves has sent the response?
0 -
Yes sure - it's a bit specific to our infrastructure.
We are caching some Yves templates to improve TTFB as we have large amounts of CMS content. We are storing the cache in redis and our Yves servers all have secondary redis instances. The primary redis is running on the Zed server. For security reasons we cannot expose the primary redis details on the Yves servers so we make the Zed call, so Zed will update the primary redis and this will then send the cache data to all of the secondary Yves instances.0 -
This is only when the cache is cold, but we still want this update to avoid any impact to customers.
0 -
If our infrastructure was different we could make the update directly from Yves.
0 -
..and so if page content is not found in Yvesβs redis, you send Zed request in order to re-publish?
0 -
Kindof - if page content is not found in Yves redis we render the template in Yves and sent the response, then we send the new cache html to Zed for Zed to persist in the primary redis
0 -
And hi Andriy! π
0 -
alright, Iβm wondering if that (syncing) canβt be achieved some how on the infrastructural level, or outside of the Yves request flow.. maybe some scheduled job or even βlambda-functionβ-like implementation that would monitor redis and βsyncβ things back to the master one. Just as some more ideas on the table. Your solution is also quite a working one here
0 -
We did consider that approach but with multiple frontend Yves servers it would be complex, and the original issue was not exposing the primary redis details on Yves servers. The feature is working well on production which is still on the silex version, we have just hit this problem while working on upgrading to the latest version.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random