Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Why Firefox is loading slowly cached CSS?

more options

I made this web app - https://fair-ad.herokuapp.com. CSS content is served by the application and it should be cached since it has header instruction "Cache-Control: public, max-age=86400". But when you go to page https://fair-ad.herokuapp.com/stuff/smartphones/Apple/iPhone+7/?feat=safety&period=2016-2017&place=&other=&lang=en (Safety tab) and click on Quality or Customization tabs you will notice the dynamic content is loaded first, before the CSS. It doesn't happen with every click on the tab but just every 2-3 clicks. This is not observable on Chrome/Chromium. I have Firefox 59.0.1 (64-bit) for Ubuntu.

I made this web app - https://fair-ad.herokuapp.com. CSS content is served by the application and it should be cached since it has header instruction "Cache-Control: public, max-age=86400". But when you go to page https://fair-ad.herokuapp.com/stuff/smartphones/Apple/iPhone+7/?feat=safety&period=2016-2017&place=&other=&lang=en (Safety tab) and click on Quality or Customization tabs you will notice the dynamic content is loaded first, before the CSS. It doesn't happen with every click on the tab but just every 2-3 clicks. This is not observable on Chrome/Chromium. I have Firefox 59.0.1 (64-bit) for Ubuntu.

Giải pháp được chọn

Could you test whether changing the sequence of tags in the <head> section -- CSS <link> tags before <script> tags -- resolves the issue? I don't know what functionality implications that might have; it probably varies from site to site.

Đọc câu trả lời này trong ngữ cảnh 👍 1

Tất cả các câu trả lời (16)

more options

Hi, I do not know. Page seems to load just find with just a tad slow when press Customization.

I will state you have errors in your HTML code re: Schema in Validator and your CSS brings up a I/O error in Jigsaw and that is bad news.

Firefox tens to be stricter in code than other browsers. W3C.org (World Wide Web Consortium) in charge of standards and practices and future development of web pages and web browsers make the rules on code. Mozilla Firefox follows these rules. W3C.org Who make the rules for web code. HTML https://validator.w3.org/ CSS https://jigsaw.w3.org/css-validator/ and https://validator.w3.org/i18n-checker/ and http://mobile.css-validator.org/

Please let us know if this solved your issue or if need further assistance.

more options

Thanks for help.

Indeed I was missing the Content-type - silly me. Now the W3C validator finds no errors. There are some warnings though and I will fix them successively but I don't think they cause the problem.

I'm afraid the problem persists. Perhaps you need to click a couple times more (Quality -> Customization -> Security). You should shortly notice the issue. (I could try recording it...)

Thanks.

Được chỉnh sửa bởi piotrkot vào

more options

I got it recorded You can see that the first few clicks make the page display fine but at around 00:00:12 there is this short blink of content without the CSS. Do you think any of the W3 HTML errors may be the reason of it?

more options

Start Firefox in Safe Mode to check if one of the extensions ("3-bar" menu button or Tools -> Add-ons -> Extensions) or if hardware acceleration is causing the problem.

  • switch to the DEFAULT theme: "3-bar" menu button or Tools -> Add-ons -> Appearance
  • do NOT click the "Refresh Firefox" button on the Safe Mode start window
more options

Thanks.

Now I see the browser is faster and I need to click around 10 times to reproduce the problem. But the problem still persists.

Actually, I was thinking of the opposite approach - to make the browser slower so that the problem occurs with every click. Then, make the Firefox logging more verbose and try to figure out the core reason of it. Do you think it is possible/a good idea?

And, by the way, is it a normal behavior for Firefox under heavy load?

more options

I do not see anything describing heavy load in your comments. Make sure that in Options --> Preferences that a check mark is in the box Prevent Accessibility Features as well You could try this please : Go the 3 Bar Menu then Options --> General --> Performance and untick everything. change the recommended size lower then see how it runs. Note: 1 = No Multiprocessor = slow again. Try 2 Restart Firefox after making these changes please.

Note : Acceleration is for your Video Card, monitor to see if need to turn back on. https://support.mozilla.org/en-US/kb/performance-settings

  • Please leave the check mark in Prevent Accessibility Services.

Please let us know if this solved your issue or if need further assistance

more options

Thanks again for help.

I didn't notice any significant difference between: 1 - "Use recommended performance setting" checked 2 - "Use recommended performance setting" unchecked and "Use hardware acceleration when available" checked and "Content process limit 4 (default)" 3 - "Use recommended performance setting" unchecked and "Use hardware acceleration when available" unchecked and "Content process limit 1"

I made restart each time. The content loads and the problem occurs every 3-4 clicks.

I did not find "Prevent Accessibility Services" option, though. Could this be as I have Firefox 59.0.1 (64-bit) for Ubuntu?

more options

No it has sorta been moved now. Is under options --> Privacy & Security --> Permissions --> Prevent accessibility services from accessing your browser

more options

Now, I found it. Checking that option didn't make any difference.

But you said you didn't notice that problem, did you? Can you please have a look at the previously attached/recorded video? Can you confirm you do not have that problem?

more options

I'm getting FOUC on nearly every page load. https://en.wikipedia.org/wiki/Flash_of_unstyled_content

Could you edit your scripts so that you do not default to display:none on the body, or you do not remove display:none until a couple hundred milliseconds later, and see whether that makes any difference?

more options

Thank you very much. Finally I know what it is.

I do not manipulate body with display:none in my scripts. It's used for modals and a few minor divs. I was hoping that putting all styles in head and ensuring that scripts come after them will do the trick. Surely, I can try fixing it as you described but since it looks as an open bug for Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=560232 https://bugzilla.mozilla.org/show_bug.cgi?id=1404468) I will better leave it and wait until they fix it.

Thanks again.

more options

piotrkot said

I do not manipulate body with display:none in my scripts. It's used for modals and a few minor divs.

Maybe you haven't visited your site with JavaScript disabled? No content is visible because:

<style id="antiClickjack">body{display:none !important;}</style>

A script overrides that at some point in the loading process.

I just think you should test whether that is contributing to the problem.

more options

Yes, you're right. I forgot about that. After removing this part from the head and testing a bit I can confirm that does not contribute to the problem.

Thanks.

more options

Giải pháp được chọn

Could you test whether changing the sequence of tags in the <head> section -- CSS <link> tags before <script> tags -- resolves the issue? I don't know what functionality implications that might have; it probably varies from site to site.

more options

Surprisingly, It fixed the problem :)

Thank you for trying that hard.

more options

piotrkot said

Surprisingly, It fixed the problem :) Thank you for trying that hard.

Thank you for the report back!