Help

Re: How best to manage a CDN (sort of) for attachments of images and PDFs for a website?

557 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Simon_Kincaid
4 - Data Explorer
4 - Data Explorer

I have created a PHP website driven by AirTable.

I have a test subdomain which is password protected with a .htpasswd file and so this connects directly to AirTable API so users can see the changes they are making.

To make the changes go live I created a compile script available on the test subdomain, which queries the API for everything we want, and turns them into json files which I put in the appropriate place so that the live website can just read these files with PHP and create the website.

This works well but the website does use the attachment URLs for things like website images and attachments. I am aware of the fact these URLs are not reliable and may be subject to change but for the moment a simple recompile would update and make everything well again.

Now though, I have a more high traffic website and I cannot take the risk of attachment URLs changing so I need some sort of solution which lets me download the images and put them somewhere else and then update the URLs in the JSON fields.

This is probably something I can code but having had a google it appears stuff like Gatsby or Netlify could do a lot of the heavy lifting here.

I am looking for anyone who has gone down this path already?

Worst case scenario is that I have to move to a normal CMS.

All ideas super welcome

Kind Regards

Simon

3 Replies 3

I have not heard of the URLs ever changing. In actuality, the REVERSE problem exists: even after you delete your attachments from Airtable, they continue to live on at their URL for at least a year, and possibly permanently.

Thanks Scott

AirTable have said the URLs may change occasionally depending on what part of the code they are working on.

I think the solution I’ve decided on is just copying the files over with a PHP script

That’s good to know, thanks!