> For the complete documentation index, see [llms.txt](https://docs.theopenpresenter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theopenpresenter.com/development/static-files.md).

# Static files

Some plugins may require us to serve many different media files. Rather than storing these in the main repo, they are stored in <https://github.com/Vija02/theopenpresenter-static/>

One way to access these files is directly through the github URL

However, to prevent CORS/ORB issue, it is recommended that you serve this file from a domain you control. There are many ways to do this like deploying a static server or proxying github.

Here is an example on how to handle this through a Cloudflare Worker:

```javascript
export default {
  async fetch(request) {
    const url = new URL(request.url);
    
    // Construct the GitHub raw URL
    const githubUrl = url.pathname === '/' 
      ? 'https://raw.githubusercontent.com/Vija02/theopenpresenter-static/refs/heads/main'
      : `https://raw.githubusercontent.com/Vija02/theopenpresenter-static/refs/heads/main${url.pathname}`;

    // Fetch from GitHub
    const response = await fetch(githubUrl, {
      cf: {
        // Cache in Cloudflare's CDN for 1 year
        cacheTtl: 31536000,
        cacheEverything: true,
      }
    });
    
    // Clone the response and add CORS headers
    const newResponse = new Response(response.body, response);
    newResponse.headers.set('Access-Control-Allow-Origin', '*');
    newResponse.headers.set('Cache-Control', 'public, max-age=31536000, immutable');
    
    return newResponse;
  }
};
```

### Configuration

By default, we will directly use the github link to access the files. To override this, define a new path in the **STATIC\_FILES\_PATH** environment variable.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.theopenpresenter.com/development/static-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
