Coder Social home page Coder Social logo

sass_inline about django-sass-processor HOT 7 CLOSED

ivictbor avatar ivictbor commented on August 24, 2024
sass_inline

from django-sass-processor.

Comments (7)

Natureshadow avatar Natureshadow commented on August 24, 2024 1

I agree that inlining CSS is bad practice. The argument about network speeds does not hold, because the requested file will be cached (in constrast, it is transmitted over the wire for every single page load if inlined).

Encouraging such bad practice is beyond the scope of django-sass-processor, imho ;). Closing this issue as @jrief seems to agree.

from django-sass-processor.

ivictbor avatar ivictbor commented on August 24, 2024

Tested django-sass-processor===0.8.2 on Django 3.2 and manifested issue was not there.

from django-sass-processor.

jrief avatar jrief commented on August 24, 2024

The problem with inlining is, that you still have to create the file. That's what you do in your example. Then however that content always will be included into the rendered HTML, otherwise the browser will cache the generated CSS file.

If you have concerns about slow networks and additional requests, go ahead and use django-compressor with django-sekizai.

Another approach is to use HTTP/2.0, there all requests are handled by in the same TCP/IP session.

from django-sass-processor.

ivictbor avatar ivictbor commented on August 24, 2024

he argument about network

Where it would be cached? Are you aware of the Google Page speed insight and May 21 SEO update? It loads simulation with a clear cache like a new user comes to read your content. So there will be no browser cache and PSI (lighthouse) simulates throttled network with big ping, so if you think your CDN will cache it be aware you will have ping time to CDN server, because of throttled delay. and you will double request the time of the critical render path.

I agree that inlining CSS is bad practice

I even can't guess why you think so because it is well-known best practice:
(copy you can google what is web dev and understand their role influence and role in tech)
https://web.dev/extract-critical-css/

image

Though HTTP 2 might solve it, but for me sounds like a well-known and recommended inlines much simpler and more compatible approach

from django-sass-processor.

Natureshadow avatar Natureshadow commented on August 24, 2024

from django-sass-processor.

ivictbor avatar ivictbor commented on August 24, 2024

How many of the page loads made from your application are first page loads of new users?
There are a lot of niches where it is critical like SEO.
Viral content, any marketing porpuses of Django websites wants EMPTY users, new users, new clients some of them will go down to funnel. Each new empty user might be bounced because of a white page duren several seconds.
https://www.searchenginewatch.com/wp-content/uploads/sites/25/2018/07/think-with-Google.jpg

Well, if you wish to challenge your new "empty cache and mobile network" users or blog readers for patience before inviting to sail funnel then your are thinking right πŸ˜‰

from django-sass-processor.

Natureshadow avatar Natureshadow commented on August 24, 2024

Well, if you wish to challenge your new "empty cache and mobile network" users or blog readers for patience before inviting to sail funnel then your are thinking right wink

Your argumentation might hold for websites that mainly deliver content (and if speed matters, really should be built into static pages instead of going through a full-blown Django…). I do not think that this is the scope of django-sass-processor β€” frameworks aiming at delivering content websites through Django will rely on SEO mechanisms, including inlining of content where it makes sense. We do not need t ocopy such functionality into django-sass-processor.

from django-sass-processor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.