> For the complete documentation index, see [llms.txt](https://documentation.immuta.com/latest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.immuta.com/latest/configuration/integrations/databricks/databricks-spark/how-to-guides/project-udfs.md).

# Project UDFs Cache Settings

Lower the web service cache timeout settings of project UDFs

This page outlines the configuration for setting up project UDFs, which allow users to set their current project in Immuta through Spark. For details about the specific functions available and how to use them, see the [Use Project UDFs (Databricks) page](/latest/governance/author-policies-for-data-access-control/projects-and-purpose-based-access-control/writing-to-projects/reference-guides/project-udfs.md).

{% hint style="info" %}
**Use project UDFs in Databricks Spark**

Currently, caches are not all invalidated outside of Databricks because Immuta caches information pertaining to a user's current project. Consequently, this feature should only be used in Databricks.
{% endhint %}

1. Lower the web service cache timeout in Immuta:
   1. Click the <i class="fa-gear">:gear:</i> **App Settings** icon and scroll to the **HDFS Cache Settings** section.
   2. Lower the **Cache TTL of HDFS user names (ms)** to **0**.
   3. Click **Save**.
2. Raise the cache timeout on your Databricks cluster: In the Spark environment variables section, set the `IMMUTA_CURRENT_PROJECT_CACHE_TIMEOUT_SECONDS` and `IMMUTA_PROJECT_CACHE_TIMEOUT_SECONDS` to high values (like `10000`).

   *Note: These caches will be invalidated on cluster when a user calls `immuta.set_current_project`, so they can effectively be cached permanently on cluster to avoid periodically reaching out to the web service.*


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.immuta.com/latest/configuration/integrations/databricks/databricks-spark/how-to-guides/project-udfs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
