Code Monkey home page Code Monkey logo

Comments (12)

tuxnull avatar tuxnull commented on May 26, 2024 1

Ok, you win

from bootstraphp.

tuxnull avatar tuxnull commented on May 26, 2024 1

Alright. init_stylesheet() now links the Bootstrap CDN and init_cdn_stylesheet() links the BootstraPHP CDN

from bootstraphp.

tuxnull avatar tuxnull commented on May 26, 2024

Hi. We have our own CDN which we use not only to always provide potential CSS fixes but also to ensure that Bootstrap doesn't just change their Stylesheets and render all BootstraPHP sites useless.
(We are already using CloudFlare for enhancements)

from bootstraphp.

mallardduck avatar mallardduck commented on May 26, 2024

Guess I'm a little confused why you can't do that with the Bootstrap CDN.
It provides a versioned URL system so there shouldn't be a concern of them "chang[ing] their Stylesheets" and breaking things.

Unless you're shipping a customized version of bootstrap the same can be accomplished by using:

https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css

Even if you are shipping a customized bootstrap file I would argue for splitting customizations into a secondary CSS file. First load the stock bootstrap.min.css then load the file with modifications (and only modifications) directly after.

from bootstraphp.

tuxnull avatar tuxnull commented on May 26, 2024

In our testing our CDN was faster than the Bootstrap CDN - maybe because we have less traffic. If this changes, I will reconsider switching to the Bootstrap CDN.

EDIT: actual numbers from testing = our CDN: ~14ms, Bootstrap CDN: ~19ms

from bootstraphp.

mallardduck avatar mallardduck commented on May 26, 2024

It feels as though you may be overlooking that every user (and internet connection) will have a different experience.

Here are the results I'm seeing:

Without Cache:

CDN Source Run # Time
Tuxnull 1 42ms
2 34ms
3 37ms
BootstrapCDN 1 27ms
2 26ms
3 25ms
CDNjs 1 24ms
2 20ms
3 33ms

With Cache:

CDN Source Run # Time
Tuxnull 1 36ms
2 34ms
3 33ms
BootstrapCDN 1 25ms
2 27ms
3 26ms
CDNjs 1 18ms
2 17ms
3 16ms

from bootstraphp.

tuxnull avatar tuxnull commented on May 26, 2024

We tested it on multiple connections... Weird that your Tuxnull response time is worse than Cloudflare's since we use Cloudflare. Did you test it on actual content or just with ping?

from bootstraphp.

mallardduck avatar mallardduck commented on May 26, 2024

Actual content - these tests were done in a real web browser. Tested with and without browser caching enabled via Chrome Dev tools. I'm not terribly surprised since CloudFlares CDNjs is easily more powerful than the free version (or lower tiers) of CloudFlare.

Further, this is only one half of the point I've raised. This won't be the best explanation, but here goes. The other half is the cache effcience you'd see from using a shared CDN. Using a shared CDN like CDNjs means there's a higher chance any given user will already have the file cached from visiting a different site.

So if I've already visiting a site utilzing Bootstrap 4 via CDNjs, then any site serving bootstrap from the same CDN gets to reuse this cached file. In the case of sites built using this tool my device will have to download and cache a second version of what's essnetially the same file.

from bootstraphp.

mallardduck avatar mallardduck commented on May 26, 2024

As I said, not the best explanation. However I found an article that does a slightly better job explaining it using jQuery as an example instead of Bootstrap.

The jQuery library will already be cached in the visitor's browser if they visited another website that references the same jQuery library. In this case, the visitor won't even have to download the jQuery library.

http://robertgreiner.com/2011/05/using-a-content-delivery-network-to-host-jquery/

from bootstraphp.

mallardduck avatar mallardduck commented on May 26, 2024

@tuxnull Sorry, it seems I may not have come across as I expected. Wasn't trying to argue, or debate, about it to "win". Just wanted to provide my 2 cents based on my own experience.

from bootstraphp.

tuxnull avatar tuxnull commented on May 26, 2024

Lol, i was just joking - I will implement it in ~ 30 minutes but it wont be in a full release until tomorrow.

from bootstraphp.

mallardduck avatar mallardduck commented on May 26, 2024

Oh! 😆
You had me, better safe than sorry though. Text cannot express tone and intention very well - I'd rather apologize for coming off the wrong way. Then have someone thinking I'm intentionally arguing for fun, or just being a troll.

from bootstraphp.

Related Issues (5)

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.