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..

If you use the Twig function `{{ product(['sku1', 'sku2']) }}` in your CMS page I guess the resultin

UM4BZSK7T
UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet
edited April 2020 in Help

If you use the Twig function {{ product(['sku1', 'sku2']) }} in your CMS page I guess the resulting HTML will be added to the page and the whole thing goes into the redis cache. But this means the cach has to be invalidated if the product data changes. I can't find any cache tags mechanism. So how will spryker know what to invalidate if the product changes?

Comments

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    there’s no β€œcache” in spryker to my awareness

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    data from rdbms (typically postgres) is normalized to a readfriendly format and then stored in redis

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    but nothing to flush out or so, data is persistent there

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Oh okay πŸ˜„ So the twig runs on every call it seems and the data is always valid.

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    so though I am not too familiar with the cms pieces, I assume that skus are resolved and product data fetched from redis on each request

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    No now that you say it I believe you are right πŸ‘

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Different concept as I remembered.

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    did you have issues with stale product data though? or why are you asking around this?

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    I just wondered how the data will be kept current. We where discussing it today but my co workers weren't so deep into Spryker. So I better asked.

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    ah ok

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    We are importing content from the sulu.io cms. And I will just add this product() twig function. So spryker can resolve the product. But if that would be cached we had a problem and might have to go asynchronous.

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    true. should not happen with spryker’s approach. if data is properly synced to redis πŸ˜‰

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    That is for sure πŸ™‚ We are heavily relying on that concept.

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    out of curiosity may I ask which kind of data is maintained in sulu?

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    All the CMS data. So in our case news, contacts and locations

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    https://beta.w-f.ch/de/wf/filiale-st-gallen All this comes from sulu. Data and images. Into Zed to Yves to Vue and that renders the content.

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    ah ok. no product related data then. but within that content, you want to display products then?

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yes that is the next step. My plan is just to use a twig function. So sulu queries the standard search already implemented. So the content managers can find one or more products. Then sulu saves the SKU. This SKU is put in a twig tag that then probably Yves and not Zed will interpret.

  • UKJND3A3H
    UKJND3A3H Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    πŸ‘

  • UM4BZSK7T
    UM4BZSK7T Posts: 174 πŸ§‘πŸ»β€πŸš€ - Cadet

    And we want to add content to products later as well. Basically a sulu snippet can hold all data and point to one or more SKU or a category. Then if that is called maybe again a twig function asks sulu for data and some how caches that.