Skip to content
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

Caching block breaks in combination with stacks (css/js does not load in) #3970

Closed
Yihka opened this issue Jun 21, 2016 · 6 comments
Closed

Comments

@Yihka
Copy link

Yihka commented Jun 21, 2016

Hello,

Block caches wrongfully while having $btCacheBlockOutput = true and setting the concrete5 settings to cache everything. It happens when you place a block in a stack and show this to users that are not logged in. When you first visit the page, it shows with the css/js, but on refresh, when it gets it out of the cache, it shows it wrongfully, as the css/js is not loaded in.

How to reproduce?
Make a stack, make a custom block, place custom block in stack, place stack on a page. Refresh twice as a non-logged in user. Make sure the block is only shown once on the page.

Additional info
C5: 5.7.5.8

@Yihka Yihka changed the title Sometimes caching blocks breaks loading in view.css Caching block breaks in combination with staples (css/js does not load in) Jun 21, 2016
@Mesuva
Copy link
Contributor

Mesuva commented Jun 21, 2016

By 'staple', do you mean a 'stack'?

@Yihka Yihka changed the title Caching block breaks in combination with staples (css/js does not load in) Caching block breaks in combination with stacks (css/js does not load in) Jun 21, 2016
@Yihka
Copy link
Author

Yihka commented Jun 21, 2016

Yes, I mean stack

@typoman76
Copy link

I can confirm this. Happened to a site we are developing in 5.7.5.8

After clearing the cache everything is working fine. And the blocks in a stack are loading their view.css. After some time when we revisit the page the view.css didn't load and blocks are unstyled.
I will check if this happens after the 6 hours when the cache should renew.
If i manually delete the files /tmp /cache in the files directory the same issue appears.

@typoman76
Copy link

Happened on a second site.
We had tonmove the css to the theme.

@Yihka
Copy link
Author

Yihka commented Aug 28, 2016

Yes it is a good temporary solution by putting it in the theme CSS but of course it's not right. CSS/JS should load depending on whether a page contains a block or not, to prevent pages from containing too much css/js that's not used.

@aembler
Copy link
Member

aembler commented Aug 30, 2016

Can you post a block that exhibits this behavior? Is this block in the application directory and manually installed, or is it part of a package?

@aembler aembler closed this as completed Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants