File Service APIs

Moving this from Billing to the UI Builder category.

My app seems to frequently have spikes of 500 file-service API calls at-a-time. This morning, I created $7 worth of API calls in about 2 minutes as a single user, just doing basic things like looking at information.

I thought this would be fixed when I setup caching, but it’s still making huge volumes of file-service API calls. How do I reduce the number of file-service API calls? I can’t imagine 500 file-service API calls (and $7) to just load a couple pages would be normal, as no app would be viable if it costs more than $3 per page load.

Hello @David_King

What you’re experiencing is likely due to the file-service API being triggered repeatedly to serve static content (e.g., images, JSON, or other assets) without proper caching and CDN configuration. Even if you’ve already enabled caching, if it’s not set up correctly or not paired with a CDN, the load may still be routed directly to Backendless — causing a spike in API calls and usage fees.

To reduce the number of file-service API calls and avoid unnecessary charges, we highly recommend reviewing and implementing the steps in this guide:
File Cache and CDN Integration Documentation

Here’s what you can do:
Set Cache-Control headers for your files or folders via the Backendless Console. This allows browsers and CDNs to cache those files instead of re-requesting them from Backendless on every page load.

Integrate a CDN (like Cloudflare, Fastly, etc.):

This allows files to be cached at edge servers and served without hitting the Backendless API every time.

You can integrate with or without Host Override, depending on your setup.

Use long-lived cache settings (max-age, public) for files that don’t change frequently, like icons, static JSON files, or images.

This setup can drastically cut down the number of file-service API calls and improve app performance — making your app more scalable and cost-effective.

If you’ve already configured caching but are still seeing a high volume of API calls, please double-check:

That the Cache-Control headers are applied correctly (especially on folders like /files/assets/),

That the browser and CDN aren’t bypassing the cache,

And that there are no dynamic file-service requests inside repeated components in your UI Builder pages.

We’re happy to walk you through your specific setup if you share more details or screenshots of your cache/CDN configuration.

Let us know how it goes!

I setup caching of the Web folder and CDN through Fastly a few months ago hoping it would fix the issue. I checked Fastly and do see it says 5.5k “Hits” out of 98k requests. I’m not a developer, but I take that to mean most file requests are not hitting the caching/cdn service.

-David

(attachments)

@David_King

  1. Try creating the ui-builder app using the example in the video. Does it work the same for you?
  2. Try to find out which files in your application are not cached and which are cached. Try to find a pattern
  • How to check if a file is cached (DevTools Guide):
  1. Open your app in Chrome (or any browser)
  2. Right-click the page → Inspect → go to the Network tab
  3. Reload the page to capture requests
  4. Filter the request list to files (images, scripts, etc.)
  5. Click on any file request → go to Headers tab
  6. Look for:
  • cache-control header (should say something like public, max-age=2678400)
  • x-cache header from Fastly (should say HIT, MISS, or BYPASS)
    HIT = File came from the CDN (success!)
    MISS or BYPASS = File was not cached — this is what we want to troubleshoot

I’ve been watching the Analytics page closely to see where my spikes in file service API calls are coming from. Many days only have 20-80 file download api calls, but days where I am actively working on the app and using preview/deploy, it spikes to 1-5k. Each “Preview” causes a spike of about 250 file-service API calls.

This is the only thing I can find causing spikes in file service API calls, despite the app only being available to a dozen early users. I thought previews and deploys weren’t counted towards billing though? Is it possible mine is billing me for these when it shouldn’t be? Or am I supposed to be billed for preview/deploy API calls, in which case everything is working as it should?

-David