Git Product home page Git Product logo

Comments (6)

benhutton avatar benhutton commented on June 23, 2024 1

sure... we are doing that too. Ideally this code would be smart enough that we wouldn't have to though!

from imgix-rb.

gregpardo avatar gregpardo commented on June 23, 2024

We have this same setup with cloudfront. You could probably do something like this... Check if the string contains more than one '?'. If it does replace any following with '&'

from imgix-rb.

axelson avatar axelson commented on June 23, 2024

@benhutton what are you doing to work around this? I'm having trouble using a cache busting timestamp

from imgix-rb.

benhutton avatar benhutton commented on June 23, 2024

@axelson I've moved away from timestamps to asset fingerprinting based based on an md5 hash of the file contents. So, your filename looks like filename-hash.ext. Here's an actual URL we're using: https://dg.imgix.net/waiting-for-god-to-text-back-vrcfown9-en/landscape/waiting-for-god-to-text-back-vrcfown9-1d26513c3498499dd96683b1dd770609.jpg

from imgix-rb.

axelson avatar axelson commented on June 23, 2024

Ah, ok. That's a bit harder for us since our server never touches the files, they go straight to s3. As far as I can tell it is actually impossible to use query parameters to bust Imgix's cache. At least I only need this as a temporary transition and Imgix's url purging endpoint seems to be working well.

from imgix-rb.

sherwinski avatar sherwinski commented on June 23, 2024

For anyone who might still be wondering about this issue/finding this over a year later, there are a few things I want to mention.
Although this might not have been the case when this issue was originally opened, in this project's latest release you can add the cache busting parameter in the following way:

client.path("/path/to/image.jpg").to_url({t:12345567})
# .../path/to/image.jpg?ixlib=rb-3.0.0&t=12345567

path() should only be passed the image path (everything before ?) while to_url() can be used to append any number of query parameters. This would avoid the double ? scenario, which can cause unexpected behavior on the imgix backend. Again, this behavior might not have always been the case. I also want to note that sometime in the future we will implement better path validation to avoid these types of scenarios.

Closing this issue now, but feel free to comment back with any questions.

from imgix-rb.

Related Issues (17)

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.