# Ísland.is Public Web Data Flow

When a user visits <https://island.is>, the picture below roughly describes how the data flows through different systems and eventually gets returned back to the user as a web page.

<figure><img src="/files/wxMBYF4espx1m0hL1qUN" alt=""><figcaption></figcaption></figure>

1. We are using Cloudfront as our CDN. There we cache HTML responses, which means if a user requests a page that's found in cache, then Cloudfront will immediately answer with a cached response instead of forwarding that request to the "web".
2. Web is a Next.js server that gets it's data from the api server via GraphQL endpoints.
3. Api is a monolithic server that is essentially a gateway for Digital Iceland frontends. \
   Developers have a choice whether they'd like to cache GraphQL endpoints and for how long that cache lasts. You can add a special `?bypass-cache=<bypass-secret>` query parameter to the end of the browser url to bypass both the CDN cache and the server cache. \
   Data gets fetched from Contentful or Elasticsearch, depending on whether we are getting single entries or searching/filtering.
4. Contentful is the CMS for the Ísland.is project and acts as the "source of truth" for our data.
5. Search-indexer is a service that syncs data from Contentful into Elasticsearch. When content changes in the CMS then a webhook calls the search-indexer and it syncs the updated data into Elasticsearch.
6. Elasticsearch is used as a search engine for the web. Content gets synced fom Contentful into Elasticsearch via the search-indexer.


---

# Agent Instructions: 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:

```
GET https://docs.devland.is/technical-overview/island.is-public-web-data-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
