Code Monkey home page Code Monkey logo

Comments (3)

kevinranks avatar kevinranks commented on August 16, 2024

Hi ping,

We debated this for some time and felt that non-versioning for the image files was the best option. I spoke with jsdelivr and confirmed that your issue with exvm-sg expiration shouldn't happen again.

When we do emoji image updates, jsdelivr purges their cache for those specific assets. If the browser does a modified check then the client will receive the new and updated emoji. Obviously if the browser doesn't do that check then they may receive an outdated file. We went with a max-age of 1 month for the images, which we felt was fair. After all it's just a suggestion to the browsers, doesn't mean they will follow it.

Also, jsdelivr prefers to not do versions on large file sets like this that often have few updates from version to version. It creates a lot of overhead in the cloning/forking process and they want to keep their repo as lightweight as possible.

I know this probably isn't the answer you wanted, but I hope you understand our position.

from emojione.

ping avatar ping commented on August 16, 2024

@kevinranks
I understand your points. But to clarify, I was not requesting that the CDN kept actual distinct versioned copies of the images, but to support a versioned "path" to the images that all point to the same 1 copy for cache-busting purposes.

Devs using sprites can already cache-bust by appending a pseudo version parameter to the css/sprite uri. Example:

/* Sprite CSS link */
<link href="//cdn.jsdelivr.net/emojione/assets/sprites/emojione.sprites.css?v=1.2.2" rel="stylesheet" type="text/css" />

/* Sprite CSS override */
[class*=emojione-] { background-image:url("//cdn.jsdelivr.net/emojione/assets/sprites/emojione.sprites.png?v=1.2.2") !important; }

But I can't use the same method for setting emojione.imagePathPNG / emojione.imagePathSVG in javascript. Perhaps, the javascript lib can support the option of appending a user-defined parameter for cache-busting?

For example emojione.cacheBustParam = 'v=1.2.2'; and when that param is defined, the path to the emoji image becomes //cdn.jsdelivr.net/emojione/assets/png/1F479.png?v=1.2.2

from emojione.

kevinranks avatar kevinranks commented on August 16, 2024

Sorry for the confusion there. I like your idea about the cache busting parameter in the libraries. Let me talk to my team and see what we can do! 😄

from emojione.

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.