From 5ac502a58c73598a1ee5efc37c0c420d336c90a9 Mon Sep 17 00:00:00 2001
From: Raphael Krut-Landau <raphael.kl@gmail.com>
Date: Fri, 17 May 2024 08:30:47 -0400
Subject: [PATCH] rebase (#42808)

---
 docs/databases/connections/athena.md          | 13 ----
 docs/databases/connections/bigquery.md        | 13 ----
 docs/databases/connections/druid.md           | 13 ----
 docs/databases/connections/mysql.md           | 13 ----
 docs/databases/connections/oracle.md          | 13 ----
 docs/databases/connections/postgresql.md      | 13 ----
 docs/databases/connections/presto.md          | 13 ----
 docs/databases/connections/redshift.md        | 13 ----
 docs/databases/connections/snowflake.md       | 13 ----
 docs/databases/connections/sparksql.md        | 13 ----
 docs/databases/connections/sql-server.md      | 13 ----
 docs/databases/connections/sqlite.md          | 13 ----
 .../default-sample-database.cy.spec.js        | 39 +----------
 .../DatabaseCacheTTLField.jsx                 | 62 -----------------
 .../DatabaseCacheTTLField.styled.tsx          | 13 ----
 .../DatabaseCacheTTLField.unit.spec.js        | 68 -------------------
 .../components/DatabaseCacheTTLField/index.js |  1 -
 .../DatabaseCacheTimeField.tsx                | 62 -----------------
 .../DatabaseCacheTimeField/index.ts           |  2 -
 .../src/metabase-enterprise/caching/index.tsx |  4 --
 .../containers/DatabaseEditApp.unit.spec.tsx  | 35 ----------
 .../components/DatabaseForm/DatabaseForm.tsx  |  8 +--
 .../cache-granular-controls.unit.spec.tsx     | 47 +------------
 .../DatabaseForm/tests/common.unit.spec.tsx   |  3 -
 .../tests/enterprise.unit.spec.tsx            | 26 -------
 frontend/src/metabase/plugins/index.ts        |  1 -
 26 files changed, 3 insertions(+), 524 deletions(-)
 delete mode 100644 enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.jsx
 delete mode 100644 enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.styled.tsx
 delete mode 100644 enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.unit.spec.js
 delete mode 100644 enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/index.js
 delete mode 100644 enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/DatabaseCacheTimeField.tsx
 delete mode 100644 enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/index.ts
 delete mode 100644 frontend/src/metabase/databases/components/DatabaseForm/tests/enterprise.unit.spec.tsx

diff --git a/docs/databases/connections/athena.md b/docs/databases/connections/athena.md
index f64554b92d7..c174f27260d 100644
--- a/docs/databases/connections/athena.md
+++ b/docs/databases/connections/athena.md
@@ -97,19 +97,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Permissions and IAM Policies
 
 Most issues that we see when people attempt to connect to AWS Athena involve permissions. Querying AWS Athena requires permissions to:
diff --git a/docs/databases/connections/bigquery.md b/docs/databases/connections/bigquery.md
index e28c737ac0e..659f72656f2 100644
--- a/docs/databases/connections/bigquery.md
+++ b/docs/databases/connections/bigquery.md
@@ -120,19 +120,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Connecting Metabase to Google Drive data sources
 
 You can connect Metabase to Google Drive data sources via BigQuery. There is some setup involved, but basically what you'll be doing is creating a dataset in BigQuery and adding an external table to that dataset that points to a Google Sheet. Useful for uploading CSVs to Google Sheets, and then analyzing and visualizing the data with Metabase.
diff --git a/docs/databases/connections/druid.md b/docs/databases/connections/druid.md
index a1ee1e4ff3b..c2982926a8e 100644
--- a/docs/databases/connections/druid.md
+++ b/docs/databases/connections/druid.md
@@ -63,19 +63,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/docs/databases/connections/mysql.md b/docs/databases/connections/mysql.md
index 2d7a2cd7d7c..bf634b4c42c 100644
--- a/docs/databases/connections/mysql.md
+++ b/docs/databases/connections/mysql.md
@@ -87,19 +87,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Connecting to MySQL 8+ servers
 
 Metabase uses the MariaDB connector to connect to MariaDB and MySQL servers. The MariaDB connector does not currently support MySQL 8's default authentication plugin, so in order to connect, you'll need to change the plugin used by the Metabase user to
diff --git a/docs/databases/connections/oracle.md b/docs/databases/connections/oracle.md
index c087302c05c..250e93b14bd 100644
--- a/docs/databases/connections/oracle.md
+++ b/docs/databases/connections/oracle.md
@@ -71,19 +71,6 @@ For more information on setting up a truststore for AWS RDS Oracle instances, se
 
 If you need to connect to other databases using SSL, instead of creating a new truststore, you'll probably want to add the RDS CA to your existing truststore file (likely called `cacerts`).
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Downloading the Oracle JDBC Driver JAR
 
 You can download a JDBC driver from [Oracle's JDBC driver downloads page](https://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html).
diff --git a/docs/databases/connections/postgresql.md b/docs/databases/connections/postgresql.md
index 4ed2a19c8c5..09300907335 100644
--- a/docs/databases/connections/postgresql.md
+++ b/docs/databases/connections/postgresql.md
@@ -160,19 +160,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/docs/databases/connections/presto.md b/docs/databases/connections/presto.md
index a126f971a77..3f0b060ede1 100644
--- a/docs/databases/connections/presto.md
+++ b/docs/databases/connections/presto.md
@@ -107,19 +107,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/docs/databases/connections/redshift.md b/docs/databases/connections/redshift.md
index 710952c76ab..ace4fa7429a 100644
--- a/docs/databases/connections/redshift.md
+++ b/docs/databases/connections/redshift.md
@@ -102,19 +102,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-## Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/docs/databases/connections/snowflake.md b/docs/databases/connections/snowflake.md
index 1fd4e78b644..592d4231d27 100644
--- a/docs/databases/connections/snowflake.md
+++ b/docs/databases/connections/snowflake.md
@@ -124,19 +124,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/docs/databases/connections/sparksql.md b/docs/databases/connections/sparksql.md
index 3ae8b6530c6..7cf7e4dd2c7 100644
--- a/docs/databases/connections/sparksql.md
+++ b/docs/databases/connections/sparksql.md
@@ -73,19 +73,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/docs/databases/connections/sql-server.md b/docs/databases/connections/sql-server.md
index 19dd173da46..6d29e4478f9 100644
--- a/docs/databases/connections/sql-server.md
+++ b/docs/databases/connections/sql-server.md
@@ -91,19 +91,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/docs/databases/connections/sqlite.md b/docs/databases/connections/sqlite.md
index 378f0900951..89093e48bdd 100644
--- a/docs/databases/connections/sqlite.md
+++ b/docs/databases/connections/sqlite.md
@@ -55,19 +55,6 @@ Turn this option **ON** to scan a sample of values every time Metabase runs a [s
 
 A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.
 
-### Default result cache duration
-
-{% include plans-blockquote.html feature="Database-specific caching" %}
-
-How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../configuring-metabase/caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
-
-Options are:
-
-- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
-- **Custom**.
-
-If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../configuring-metabase/caching.md#advanced-caching-controls).
-
 ## Further reading
 
 - [Managing databases](../../databases/connecting.md)
diff --git a/e2e/test/scenarios/admin/databases/default-sample-database.cy.spec.js b/e2e/test/scenarios/admin/databases/default-sample-database.cy.spec.js
index 376279afeac..11e90d06318 100644
--- a/e2e/test/scenarios/admin/databases/default-sample-database.cy.spec.js
+++ b/e2e/test/scenarios/admin/databases/default-sample-database.cy.spec.js
@@ -1,13 +1,7 @@
 import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
 import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
 import { ORDERS_QUESTION_ID } from "e2e/support/cypress_sample_instance_data";
-import {
-  restore,
-  popover,
-  modal,
-  describeEE,
-  setTokenFeatures,
-} from "e2e/support/helpers";
+import { modal, popover, restore } from "e2e/support/helpers";
 import {
   createMetric,
   createSegment,
@@ -301,35 +295,4 @@ describe("scenarios > admin > databases > sample database", () => {
       cy.findByText("Sample Database").should("exist");
     });
   });
-
-  describeEE("custom caching", () => {
-    it("should set custom cache ttl", () => {
-      setTokenFeatures("all");
-      cy.request("PUT", "api/setting/enable-query-caching", { value: true });
-
-      visitDatabase(SAMPLE_DB_ID).then(({ response: { body } }) => {
-        expect(body.cache_ttl).to.be.null;
-      });
-
-      // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
-      cy.findByText("Show advanced options").click();
-
-      setCustomCacheTTLValue("48");
-
-      cy.button("Save changes").click();
-      cy.wait("@databaseUpdate").then(({ request, response }) => {
-        expect(request.body.cache_ttl).to.equal(48);
-        expect(response.body.cache_ttl).to.equal(48);
-      });
-
-      function setCustomCacheTTLValue(value) {
-        cy.findAllByTestId("select-button")
-          .contains("Use instance default (TTL)")
-          .click();
-
-        popover().findByText("Custom").click();
-        cy.findByDisplayValue("24").clear().type(value).blur();
-      }
-    });
-  });
 });
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.jsx b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.jsx
deleted file mode 100644
index e6c1707a194..00000000000
--- a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.jsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import PropTypes from "prop-types";
-import { useCallback, useEffect, useState } from "react";
-import { t } from "ttag";
-
-import Select, { Option } from "metabase/core/components/Select";
-
-import CacheTTLField from "../CacheTTLField";
-
-import {
-  CacheFieldContainer,
-  FieldContainer,
-} from "./DatabaseCacheTTLField.styled";
-
-const MODE = {
-  INSTANCE_DEFAULT: "instance-default",
-  CUSTOM: "custom",
-};
-
-const INSTANCE_DEFAULT_CACHE_TTL = null;
-const DEFAULT_CUSTOM_CACHE_TTL = 24; // hours
-
-const propTypes = {
-  field: PropTypes.object.isRequired,
-};
-
-function DatabaseCacheTTLField({ field }) {
-  const [mode, setMode] = useState(
-    field.value > 0 ? MODE.CUSTOM : MODE.INSTANCE_DEFAULT,
-  );
-
-  const onModeChange = useCallback(e => {
-    setMode(e.target.value);
-  }, []);
-
-  useEffect(() => {
-    if (mode === MODE.INSTANCE_DEFAULT) {
-      field.onChange(INSTANCE_DEFAULT_CACHE_TTL);
-    } else if (field.value == null) {
-      field.onChange(DEFAULT_CUSTOM_CACHE_TTL);
-    }
-  }, [field, mode]);
-
-  return (
-    <FieldContainer>
-      <Select value={mode} onChange={onModeChange}>
-        <Option value={MODE.INSTANCE_DEFAULT}>
-          {t`Use instance default (TTL)`}
-        </Option>
-        <Option value={MODE.CUSTOM}>{t`Custom`}</Option>
-      </Select>
-      {mode === MODE.CUSTOM && (
-        <CacheFieldContainer>
-          <CacheTTLField field={field} />
-        </CacheFieldContainer>
-      )}
-    </FieldContainer>
-  );
-}
-
-DatabaseCacheTTLField.propTypes = propTypes;
-
-export default DatabaseCacheTTLField;
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.styled.tsx b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.styled.tsx
deleted file mode 100644
index e0d88ee182d..00000000000
--- a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.styled.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import styled from "@emotion/styled";
-
-import { space } from "metabase/styled-components/theme";
-
-export const FieldContainer = styled.div`
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-`;
-
-export const CacheFieldContainer = styled.div`
-  margin-left: ${space(2)};
-`;
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.unit.spec.js b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.unit.spec.js
deleted file mode 100644
index 52e20bf2aaa..00000000000
--- a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/DatabaseCacheTTLField.unit.spec.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import { render, screen, waitFor } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-
-import DatabaseCacheTTLField from "./DatabaseCacheTTLField";
-
-function setup({ value = null } = {}) {
-  const onChange = jest.fn();
-  render(
-    <DatabaseCacheTTLField field={{ name: "cache_ttl", value, onChange }} />,
-  );
-  return { onChange };
-}
-
-async function selectMode(nextMode) {
-  const currentModeLabel =
-    nextMode === "custom" ? "Use instance default (TTL)" : "Custom";
-  const nextModeLabel =
-    nextMode === "instance-default" ? "Use instance default (TTL)" : "Custom";
-
-  await userEvent.click(screen.getByText(currentModeLabel));
-  await userEvent.click(screen.getByText(nextModeLabel));
-}
-
-describe("DatabaseCacheTTLField", () => {
-  it("displays 'Use instance default' option when cache_ttl is null", () => {
-    setup({ value: null });
-    expect(screen.getByText("Use instance default (TTL)")).toBeInTheDocument();
-    expect(screen.queryByLabelText("Cache TTL Field")).not.toBeInTheDocument();
-  });
-
-  it("displays 'Use instance default' option when cache_ttl is 0", () => {
-    setup({ value: 0 });
-    expect(screen.getByText("Use instance default (TTL)")).toBeInTheDocument();
-    expect(screen.queryByLabelText("Cache TTL Field")).not.toBeInTheDocument();
-  });
-
-  it("sets 24 hours as a default TTL custom value", async () => {
-    const { onChange } = setup();
-    await selectMode("custom");
-    await waitFor(() => expect(onChange).toHaveBeenLastCalledWith(24));
-  });
-
-  it("can select and fill custom cache TTL value", async () => {
-    const { onChange } = setup();
-
-    await selectMode("custom");
-    const input = screen.getByPlaceholderText("24");
-    await userEvent.type(input, "{selectall}{backspace}14");
-    input.blur();
-
-    expect(onChange).toHaveBeenLastCalledWith(14);
-  });
-
-  it("displays input when cache_ttl has value", () => {
-    setup({ value: 4 });
-    expect(screen.getByDisplayValue("4")).toBeInTheDocument();
-    expect(screen.getByText("Custom")).toBeInTheDocument();
-    expect(
-      screen.queryByText("Use instance default (TTL)"),
-    ).not.toBeInTheDocument();
-  });
-
-  it("can reset cache_ttl to instance default", async () => {
-    const { onChange } = setup({ value: 48 });
-    await selectMode("instance-default");
-    await waitFor(() => expect(onChange).toHaveBeenLastCalledWith(null));
-  });
-});
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/index.js b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/index.js
deleted file mode 100644
index eedffdc43ac..00000000000
--- a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTTLField/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "./DatabaseCacheTTLField";
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/DatabaseCacheTimeField.tsx b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/DatabaseCacheTimeField.tsx
deleted file mode 100644
index f4bd0eeaa30..00000000000
--- a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/DatabaseCacheTimeField.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { useField, useFormikContext } from "formik";
-import { useCallback } from "react";
-import { jt, t } from "ttag";
-
-import FormField from "metabase/core/components/FormField";
-import Link from "metabase/core/components/Link/Link";
-import { useUniqueId } from "metabase/hooks/use-unique-id";
-import type { DatabaseData } from "metabase-types/api";
-
-import DatabaseCacheTimeInput from "../DatabaseCacheTimeInput";
-
-const FIELD = "cache_ttl";
-const SECTION = "advanced-options";
-
-const DatabaseCacheTimeField = () => {
-  const id = useUniqueId();
-  const [{ value, onBlur }, { error, touched }, { setValue }] = useField(FIELD);
-  const { values } = useFormikContext<DatabaseData>();
-
-  const handleChange = useCallback(
-    (value?: number) => setValue(value != null ? value : null),
-    [setValue],
-  );
-
-  if (!values.details[SECTION]) {
-    return null;
-  }
-
-  return (
-    <FormField
-      title={t`Default result cache duration`}
-      description={<DatabaseCacheTimeDescription />}
-      htmlFor={id}
-      error={touched ? error : undefined}
-    >
-      <DatabaseCacheTimeInput
-        id={id}
-        name={FIELD}
-        value={value ?? undefined}
-        error={touched && error != null}
-        onChange={handleChange}
-        onBlur={onBlur}
-      />
-    </FormField>
-  );
-};
-
-const DatabaseCacheTimeDescription = (): JSX.Element => {
-  return (
-    <div>
-      {/* eslint-disable-next-line no-literal-metabase-strings -- Metabase settings */}
-      {jt`How long to keep question results. By default, Metabase will use the value you supply on the ${(
-        <Link key="link" to="/admin/settings/caching">
-          {t`cache settings page`}
-        </Link>
-      )}, but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.`}
-    </div>
-  );
-};
-
-// eslint-disable-next-line import/no-default-export -- deprecated usage
-export default DatabaseCacheTimeField;
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/index.ts b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/index.ts
deleted file mode 100644
index 66eba6e7c54..00000000000
--- a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCacheTimeField/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-// eslint-disable-next-line import/no-default-export -- deprecated usage
-export { default } from "./DatabaseCacheTimeField";
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/index.tsx b/enterprise/frontend/src/metabase-enterprise/caching/index.tsx
index 32c1c232480..0ad0c236d31 100644
--- a/enterprise/frontend/src/metabase-enterprise/caching/index.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/caching/index.tsx
@@ -3,8 +3,6 @@ import { hasPremiumFeature } from "metabase-enterprise/settings";
 
 import CacheTTLField from "./components/CacheTTLField";
 import { DashboardStrategySidebar } from "./components/DashboardStrategySidebar";
-import DatabaseCacheTTLField from "./components/DatabaseCacheTTLField";
-import DatabaseCacheTimeField from "./components/DatabaseCacheTimeField";
 import { GranularControlsExplanation } from "./components/GranularControlsExplanation";
 import { InvalidateNowButton } from "./components/InvalidateNowButton";
 import QuestionCacheTTLField from "./components/QuestionCacheTTLField";
@@ -26,11 +24,9 @@ if (hasPremiumFeature("cache_granular_controls")) {
   };
 
   PLUGIN_FORM_WIDGETS.dashboardCacheTTL = CacheTTLField;
-  PLUGIN_FORM_WIDGETS.databaseCacheTTL = DatabaseCacheTTLField;
   PLUGIN_FORM_WIDGETS.questionCacheTTL = QuestionCacheTTLField;
 
   PLUGIN_CACHING.getQuestionsImplicitCacheTTL = getQuestionsImplicitCacheTTL;
-  PLUGIN_CACHING.DatabaseCacheTimeField = DatabaseCacheTimeField;
   PLUGIN_CACHING.StrategyFormLauncherPanel = StrategyFormLauncherPanel;
   PLUGIN_CACHING.isEnabled = () => true;
   PLUGIN_CACHING.hasQuestionCacheSection = hasQuestionCacheSection;
diff --git a/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.unit.spec.tsx b/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.unit.spec.tsx
index 2cb243e9b5d..1dd8601df5c 100644
--- a/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.unit.spec.tsx
+++ b/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.unit.spec.tsx
@@ -1,7 +1,6 @@
 import userEvent from "@testing-library/user-event";
 import { IndexRoute, Route } from "react-router";
 
-import { setupEnterpriseTest } from "__support__/enterprise";
 import { callMockEvent } from "__support__/events";
 import {
   setupDatabaseEndpoints,
@@ -204,38 +203,4 @@ describe("DatabaseEditApp", () => {
       ).not.toBeInTheDocument();
     });
   });
-
-  describe("Cache TTL field", () => {
-    describe("OSS", () => {
-      it("is invisible", async () => {
-        await setup({ cachingEnabled: true });
-
-        expect(
-          screen.queryByText("Default result cache duration"),
-        ).not.toBeInTheDocument();
-      });
-    });
-
-    describe("EE", () => {
-      beforeEach(() => {
-        setupEnterpriseTest();
-      });
-
-      it("is visible", async () => {
-        await setup({ cachingEnabled: true });
-
-        expect(
-          screen.getByText("Default result cache duration"),
-        ).toBeInTheDocument();
-      });
-
-      it("is invisible when caching disabled", async () => {
-        await setup({ cachingEnabled: false });
-
-        expect(
-          screen.queryByText("Default result cache duration"),
-        ).not.toBeInTheDocument();
-      });
-    });
-  });
 });
diff --git a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx
index 3f2e94fe01f..27dad758fde 100644
--- a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx
@@ -8,10 +8,9 @@ import FormFooter from "metabase/core/components/FormFooter";
 import FormSubmitButton from "metabase/core/components/FormSubmitButton";
 import { Form, FormProvider } from "metabase/forms";
 import { useSelector } from "metabase/lib/redux";
-import { PLUGIN_CACHING } from "metabase/plugins";
 import type { DatabaseData, Engine } from "metabase-types/api";
 
-import { getEngines, getIsCachingEnabled, getIsHosted } from "../../selectors";
+import { getEngines, getIsHosted } from "../../selectors";
 import { getDefaultEngineKey } from "../../utils/engine";
 import {
   getSubmitValues,
@@ -46,7 +45,6 @@ export const DatabaseForm = ({
 }: DatabaseFormProps): JSX.Element => {
   const engines = useSelector(getEngines);
   const isHosted = useSelector(getIsHosted);
-  const isCachingEnabled = useSelector(getIsCachingEnabled);
   const initialEngineKey = getEngineKey(engines, initialData, isAdvanced);
   const [engineKey, setEngineKey] = useState(initialEngineKey);
   const engine = getEngine(engines, engineKey);
@@ -91,7 +89,6 @@ export const DatabaseForm = ({
         autofocusFieldName={autofocusFieldName}
         isHosted={isHosted}
         isAdvanced={isAdvanced}
-        isCachingEnabled={isCachingEnabled}
         onEngineChange={handleEngineChange}
         onCancel={onCancel}
         setIsDirty={setIsDirty}
@@ -107,7 +104,6 @@ interface DatabaseFormBodyProps {
   autofocusFieldName?: string;
   isHosted: boolean;
   isAdvanced: boolean;
-  isCachingEnabled: boolean;
   onEngineChange: (engineKey: string | undefined) => void;
   onCancel?: () => void;
   setIsDirty?: (isDirty: boolean) => void;
@@ -120,7 +116,6 @@ const DatabaseFormBody = ({
   autofocusFieldName,
   isHosted,
   isAdvanced,
-  isCachingEnabled,
   onEngineChange,
   onCancel,
   setIsDirty,
@@ -158,7 +153,6 @@ const DatabaseFormBody = ({
           data-kek={field.name}
         />
       ))}
-      {isCachingEnabled && <PLUGIN_CACHING.DatabaseCacheTimeField />}
       <DatabaseFormFooter
         isDirty={dirty}
         isAdvanced={isAdvanced}
diff --git a/frontend/src/metabase/databases/components/DatabaseForm/tests/cache-granular-controls.unit.spec.tsx b/frontend/src/metabase/databases/components/DatabaseForm/tests/cache-granular-controls.unit.spec.tsx
index 35a245e74bb..263daf90eeb 100644
--- a/frontend/src/metabase/databases/components/DatabaseForm/tests/cache-granular-controls.unit.spec.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseForm/tests/cache-granular-controls.unit.spec.tsx
@@ -1,6 +1,6 @@
 import userEvent from "@testing-library/user-event";
 
-import { screen, waitFor } from "__support__/ui";
+import { screen } from "__support__/ui";
 import {
   createMockSettings,
   createMockTokenFeatures,
@@ -23,56 +23,11 @@ const setupGranularCacheControls = (opts: SetupOpts) => {
 };
 
 describe("DatabaseForm", () => {
-  it("should show caching controls in advanced options when caching is enabled", async () => {
-    setupGranularCacheControls({ isCachingEnabled: true });
-    expect(screen.getByText("Display name")).toBeInTheDocument();
-    expect(
-      screen.queryByText("Default result cache duration"),
-    ).not.toBeInTheDocument();
-
-    await userEvent.click(screen.getByText("Show advanced options"));
-    expect(
-      screen.getByText("Default result cache duration"),
-    ).toBeInTheDocument();
-  });
-
   it("should not allow to configure cache ttl when query caching is not enabled", async () => {
     setupGranularCacheControls({ isCachingEnabled: false });
     await userEvent.click(screen.getByText("Show advanced options"));
     expect(
       screen.getByText("Choose when syncs and scans happen"),
     ).toBeInTheDocument();
-    expect(
-      screen.queryByText("Default result cache duration"),
-    ).not.toBeInTheDocument();
-  });
-
-  it("should allow to submit the form with the cache ttl value", async () => {
-    const { onSubmit } = setupGranularCacheControls({ isCachingEnabled: true });
-
-    await userEvent.type(screen.getByLabelText("Display name"), "H2");
-    await userEvent.type(
-      screen.getByLabelText("Connection String"),
-      "file:/db",
-    );
-    await userEvent.click(screen.getByText("Show advanced options"));
-    await userEvent.click(screen.getByText("Use instance default (TTL)"));
-    await userEvent.click(screen.getByText("Custom"));
-
-    const cacheInput = screen.getByPlaceholderText("24");
-    await userEvent.clear(cacheInput);
-    await userEvent.type(cacheInput, "10");
-
-    const saveButton = screen.getByRole("button", { name: "Save" });
-    await waitFor(() => expect(saveButton).toBeEnabled());
-
-    await userEvent.click(saveButton);
-    await waitFor(() => {
-      expect(onSubmit).toHaveBeenCalledWith(
-        expect.objectContaining({
-          cache_ttl: 10,
-        }),
-      );
-    });
   });
 });
diff --git a/frontend/src/metabase/databases/components/DatabaseForm/tests/common.unit.spec.tsx b/frontend/src/metabase/databases/components/DatabaseForm/tests/common.unit.spec.tsx
index 674bbeab203..e76c08f1e79 100644
--- a/frontend/src/metabase/databases/components/DatabaseForm/tests/common.unit.spec.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseForm/tests/common.unit.spec.tsx
@@ -42,9 +42,6 @@ describe("DatabaseForm", () => {
     expect(
       screen.getByText("Choose when syncs and scans happen"),
     ).toBeInTheDocument();
-    expect(
-      screen.queryByText("Default result cache duration"),
-    ).not.toBeInTheDocument();
   });
 });
 
diff --git a/frontend/src/metabase/databases/components/DatabaseForm/tests/enterprise.unit.spec.tsx b/frontend/src/metabase/databases/components/DatabaseForm/tests/enterprise.unit.spec.tsx
deleted file mode 100644
index 4db3f76b59e..00000000000
--- a/frontend/src/metabase/databases/components/DatabaseForm/tests/enterprise.unit.spec.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import userEvent from "@testing-library/user-event";
-
-import { screen } from "__support__/ui";
-
-import type { SetupOpts } from "./setup";
-import { setup } from "./setup";
-
-const setupEnterprise = (opts?: SetupOpts) => {
-  return setup({
-    ...opts,
-    hasEnterprisePlugins: true,
-  });
-};
-
-describe("DatabaseForm", () => {
-  it("should not allow to configure cache ttl", async () => {
-    setupEnterprise({ isCachingEnabled: true });
-    await userEvent.click(screen.getByText("Show advanced options"));
-    expect(
-      screen.getByText("Choose when syncs and scans happen"),
-    ).toBeInTheDocument();
-    expect(
-      screen.queryByText("Default result cache duration"),
-    ).not.toBeInTheDocument();
-  });
-});
diff --git a/frontend/src/metabase/plugins/index.ts b/frontend/src/metabase/plugins/index.ts
index f753535ffe9..0c4cd8f8793 100644
--- a/frontend/src/metabase/plugins/index.ts
+++ b/frontend/src/metabase/plugins/index.ts
@@ -351,7 +351,6 @@ export const PLUGIN_CACHING = {
   dashboardCacheTTLFormField: null,
   questionCacheTTLFormField: null,
   getQuestionsImplicitCacheTTL: (_question?: any) => null as number | null,
-  DatabaseCacheTimeField: PluginPlaceholder as any,
   StrategyFormLauncherPanel: PluginPlaceholder as any,
   GranularControlsExplanation: PluginPlaceholder as any,
   DashboardStrategySidebar: PluginPlaceholder as any,
-- 
GitLab