Help

Attachment changes and API

Topic Labels: API
Solved
Jump to Solution
1335 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Kiuri
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello all, I have a question regarding the changes to the attachment url’s.
I have images stored on Airtable that I fetch using the API and display them on my site. I am not using the any permanent link. Whenever a user accesses the site, it requests the data and gets the image url and displays it. Will the changes affect this use case? For example, I know that cloudfare may cache the temporary url and then feed it to the public, but does that mean that some users will get a blank image instead of the new url?

Thanks in advance

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

As long as there is always a fresh call to the Airtable REST API with each visit, you should be fine.

See Solution in Thread

4 Replies 4
kuovonne
18 - Pluto
18 - Pluto

As long as there is always a fresh call to the Airtable REST API with each visit, you should be fine.

If upon every visit your page requests the URL from API, this should be OK, but would be best suited for page with small number of visits.

If you expect high number of traffic it would be best to cache those images somewhere. Not sure what exactly you are using to build your page - but if React - Next JS has a fantastic cached and optimized image element (including responsive and format optimization):

As image source you could use NextJs API route, which would make request to Airtable API. This works with high traffic volume, but also also you can set how often to revalidate and re-request the image from Airtable.

Kiuri
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you! Yes at the moment I am requesting it with each visit. Do you think this might be an issue with Cloudfare?

Kiuri
5 - Automation Enthusiast
5 - Automation Enthusiast

That’s pretty neat, thank you! Sadly the client wanted the project to be built in Framer, so I can’t go the NextJS route. And because we don’t have access to routing inside Framer, I need to load info from Airtable using url params, with each visit, as there is no dynamic routing. Luckily, it is a very low traffic site.