Skip to content

Changing app/design/frontend/Mytheme/default/etc/view.xml - gallery var does not clear the necessary cache #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amenk opened this issue Oct 27, 2019 · 6 comments
Labels
more-info-required Further information is requested

Comments

@amenk
Copy link

amenk commented Oct 27, 2019

It clears block_html + full_page when I can

        <var name="nav">thumbs</var> <!-- Gallery navigation style (false/thumbs/dots) -->

to
dots

but I don't see an effect.

Clearing all caches helps :)

@Vinai
Copy link
Contributor

Vinai commented Oct 28, 2019

Thanks for the report. There must be an additional cache that is used.
Unfortunately the \Magento\Framework\View\Config class doesn't follow the same pattern as most other config classes, where the caching is handled by them directly. I'll have to dig a little.

@Vinai
Copy link
Contributor

Vinai commented Oct 28, 2019

I just tried it and changed

<var name="gallery">
            <var name="nav">thumbs</var> <!-- Gallery navigation style (false/thumbs/dots) -->

to

<var name="gallery">
            <var name="nav">dots</var> <!-- Gallery navigation style (false/thumbs/dots) -->

using the luma theme.
The cache watcher cleaned the block_html and luma caches, and that was enough to apply the change during reload.

Two questions to help nail this down:

  • What version of Magento are you using (2.3.2 here)?
  • Can you please post your cache configuration from the app/etc/env.php?

Thanks!

@Vinai Vinai added the more-info-required Further information is requested label Oct 28, 2019
@amenk
Copy link
Author

amenk commented Oct 29, 2019

  • 2.3.2-p1
  • app/etc/env.php I have to check, but it should be pretty standard.

But I am not using luma (I did not know there is a luma cache), but the snowdog SASS theme as a base - probably that is the problem?

What is the luma cache?

@Vinai
Copy link
Contributor

Vinai commented Oct 29, 2019

Um, there is no luma cache, I meant layout - sorry :D

If you are using the file system cache storage, I suspect you are running into the bug fixed by this PR: magento/magento2#22228

Since Magento 2.1 there is a bug that causes the full page cache records to be written to the var/cache directory instead of var/page_cache. This issue causes the cache cleaner behavior to be erratic, mostly by FPC cache cleans having no effect.
There is an easy workaround, namely removing all cache configuration from the default app/etc/env.php. The bug only affects the default config with the file system cache backend. Redis or Varnish are not affected. The bug will be fixed in the (currently upcoming) Magento 2.3.4 release.

As stated above, as a workaround you could remove the cache config from the app/etc/env.php or alternatively, here an example of a file cache backend config with a cache ID prefix:

    'cache' => [
        'frontend' => [
            'default' => [
                'id_prefix' => 'e74_'
            ],
            'page_cache' => [
                'id_prefix' => 'e74_',
                'backend_options' => [
                    'cache_dir' => 'page_cache'
                ]
            ]
        ]
    ],

If you are using redis or varnish, the issue must have a different cause and will require more info.

@Vinai
Copy link
Contributor

Vinai commented Dec 14, 2019

@amenk Can you please check if the issue is related to the page cache backend configuration bug I described above?

@amenk
Copy link
Author

amenk commented Jan 7, 2020

cache-clean --version 1.0.15 = 1.0.15

my cache config in env.php

'cache' => [
    'frontend' => [
        'default' => [
            'id_prefix' => 'e4f_'
        ],
        'page_cache' => [
            'id_prefix' => 'e4f_'
        ]
    ]
],

view.xml edited -> no effect (but fpc and blockhtml is cleared)

            'backend_options' => [
                'cache_dir' => 'page_cache'
            ]

added

-> Works

So I guess you were right, thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-required Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants