Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2528c56
feat: cleanup before beta
derrickmehaffy Jan 3, 2025
9106e05
remove new yarn.lock
derrickmehaffy Jan 3, 2025
5cd82e1
temp fix pluginId build issue
derrickmehaffy Jan 3, 2025
2986656
chore: drop support for couchbase as a cache provider
boazpoolman Aug 6, 2025
ba6f459
refactor: migrate the 'plugin-rest-cache' server from CJS to ESM
boazpoolman Aug 6, 2025
a77baea
fix: new export '/types' for 'plugin-rest-cache' to allow providers t…
boazpoolman Aug 6, 2025
9895bde
fix: enforce gitignore for the /.strapi folder
boazpoolman Aug 6, 2025
99eb024
fix: clean up old namespaces
boazpoolman Aug 6, 2025
c6776fe
fix: downgrade 'cache-manager' to prevent issues, upgrading will be d…
boazpoolman Aug 6, 2025
3e1e809
chore: clean up dependency management and update Strapi
boazpoolman Aug 6, 2025
2887780
chore: update lockfile
boazpoolman Aug 6, 2025
6d86ae6
chore: remove giscus from the docs to prevent clutter and generic sup…
boazpoolman Aug 9, 2025
cbbf00a
docs: enfore the namespace change on the documentation website
boazpoolman Aug 9, 2025
b7d9442
docs: add versioned documentation for the old v4 plugin
boazpoolman Aug 9, 2025
b2fc61e
docs: update the installation abbreviation
boazpoolman Aug 9, 2025
28dbf10
fix: make the memory provider installed by default as it was in v4
boazpoolman Aug 10, 2025
4fe7015
chore: add a todo about loading external providers
boazpoolman Aug 10, 2025
88b631f
fix: migrate the code to reflect v5 api changes
boazpoolman Aug 10, 2025
a1e7e0d
Merge branch 'dev/v5BetaCleanup' of github.com:strapi-community/plugi…
boazpoolman Aug 10, 2025
28928cf
feat: migrate cache-manager to v7
boazpoolman Aug 11, 2025
280d1ad
refactor: update the debug identifier to reflect the plugin name change
boazpoolman Aug 11, 2025
d3801be
Merge branch 'dev/v5-docs' of github.com:strapi-community/plugin-rest…
boazpoolman Aug 11, 2025
79d4c4a
fix: use pack-up instead of strapi-plugin cli to build the plugin fro…
boazpoolman Aug 11, 2025
8ea6c15
Merge branch 'dev/v5BetaCleanup' of github.com:strapi-community/plugi…
boazpoolman Aug 11, 2025
7a6a80b
Merge branch 'dev/v5-docs' of github.com:strapi-community/plugin-rest…
boazpoolman Aug 11, 2025
d1c617b
fix: put a default maxSize option for the quick-lru adapter
boazpoolman Aug 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: Release ${{ steps.meta.outputs.tag }}
body: View [CHANGELOG.md](https://github.com/strapi-community/strapi-plugin-rest-cache/blob/main/CHANGELOG.md) for details
body: View [CHANGELOG.md](https://github.com/strapi-community/plugin-rest-cache/blob/main/CHANGELOG.md) for details
draft: false
prerelease: false
discussion_category_name: announcements
discussion_category_name: announcements
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.19.1
v20.18.0
26 changes: 14 additions & 12 deletions BENCHMARKS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Benchmarks

These benchmarks are out of date for the current version of the plugin. They are kept here for reference and might be updated in the future.

## Context

- Rest cache version: `4.2.4`
Expand All @@ -15,13 +17,13 @@
$ ENABLE_CACHE=false yarn profile:memory
```

| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
| ----------- | ------- | ------- | ------- | ------- | ---------- | --------- | ------- |
| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
|-------------|---------|---------|---------|---------|------------|--------|---------|
| **Latency** | 2424 ms | 2555 ms | 2921 ms | 3012 ms | 2565.12 ms | 133.23 | 3401 ms |

| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
| ------------- | --- | ---- | ------ | ------- | ------ | ------ | ------ |
| **Req/Sec** | 0 | 0 | 386 | 1000 | 383.34 | 382.38 | 39 |
| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|---------------|-----|------|--------|---------|--------|--------|---------|
| **Req/Sec** | 0 | 0 | 386 | 1000 | 383.34 | 382.38 | 39 |
| **Bytes/Sec** | 0 B | 0 B | 453 kB | 1.17 MB | 450 kB | 449 kB | 45.7 kB |

### Cache enabled (without etag)
Expand All @@ -30,12 +32,12 @@ $ ENABLE_CACHE=false yarn profile:memory
$ ENABLE_ETAG=false yarn profile:memory
```

| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
| ----------- | ------ | ------ | ------ | ------ | --------- | ------- | ------ |
| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
|-------------|--------|--------|--------|--------|-----------|----------|--------|
| **Latency** | 113 ms | 116 ms | 166 ms | 175 ms | 120.04 ms | 12.86 ms | 275 ms |

| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
| ------------- | ------- | ------- | ------- | ------- | ------- | ------ | ------- |
|---------------|---------|---------|---------|---------|---------|--------|---------|
| **Req/Sec** | 7451 | 7523 | 8287 | 8687 | 8293.49 | 306.35 | 6381 |
| **Bytes/Sec** | 8.85 MB | 8.93 MB | 9.84 MB | 10.3 MB | 9.84 MB | 364 kB | 7.57 MB |

Expand All @@ -46,10 +48,10 @@ $ yarn profile:memory
```

| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
| ----------- | ------ | ------ | ------ | ------ | --------- | -------- | ------ |
|-------------|--------|--------|--------|--------|-----------|----------|--------|
| **Latency** | 119 ms | 125 ms | 185 ms | 197 ms | 131.05 ms | 16.87 ms | 307 ms |

| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
| ------------- | ------- | ------- | ------- | ------- | ------- | ------ | ------- |
| **Req/Sec** | 6551 | 6559 | 7651 | 8231 | 7599.39 | 472.94 | 6100 |
| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|---------------|---------|---------|--------|---------|---------|--------|--------|
| **Req/Sec** | 6551 | 6559 | 7651 | 8231 | 7599.39 | 472.94 | 6100 |
| **Bytes/Sec** | 8.05 MB | 8.07 MB | 9.4 MB | 10.1 MB | 9.34 MB | 581 kB | 7.5 MB |
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<p style="margin-top: 0;">Speed-up HTTP requests with LRU cache.</p>

<p>
<a href="https://www.npmjs.org/package/strapi-plugin-rest-cache">
<img src="https://img.shields.io/npm/v/strapi-plugin-rest-cache/latest.svg" alt="NPM Version" />
<a href="https://www.npmjs.org/package/@strapi-community/plugin-rest-cache">
<img src="https://img.shields.io/npm/v/@strapi-community/plugin-rest-cache/latest.svg" alt="NPM Version" />
</a>
<a href="https://www.npmjs.org/package/strapi-plugin-rest-cache">
<img src="https://img.shields.io/npm/dm/strapi-plugin-rest-cache" alt="Monthly download on NPM" />
<a href="https://www.npmjs.org/package/@strapi-community/plugin-rest-cache">
<img src="https://img.shields.io/npm/dm/@strapi-community/plugin-rest-cache" alt="Monthly download on NPM" />
</a>
</p>
</div>
Expand Down Expand Up @@ -46,7 +46,7 @@ Supported Strapi Versions:

## 🚚 Getting Started

[Read the Docs to Learn More.](https://strapi-community.github.io/strapi-plugin-rest-cache/)
[Read the Docs to Learn More.](https://strapi-community.github.io/plugin-rest-cache/)

## Contributing

Expand Down
29 changes: 29 additions & 0 deletions docs/.vitepress/components/LegacyWarning.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script setup lang="ts">
import { useData, useRoute } from 'vitepress'
import { computed } from 'vue'

const { site } = useData()
const route = useRoute()

// Define which versions should show the legacy warning
const legacyVersions = ['4.x.x']

// Check if current URL starts with any version folder name
const shouldShowWarning = computed(() => {
const path = route.path
return legacyVersions.some(version => path.startsWith(`${site.value.base}${version}/`))
})
</script>

<template>
<div v-if="shouldShowWarning" class="warning custom-block">
<p class="custom-block-title">WARNING</p>
<p>You're looking at the old Rest Cache plugin documentation for <strong>Strapi v4</strong>. Documentation for Strapi v5 can be <a :href="`${site.base}guide/`">found here</a>.</p>
</div>
</template>

<style scoped>
.warning {
margin-bottom: 2rem;
}
</style>
161 changes: 161 additions & 0 deletions docs/.vitepress/components/VersionSwitcher.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<script setup lang="ts">
import { useData, useRouter } from "vitepress"
import { computed, ref } from 'vue'
import VPMenuLink from 'vitepress/dist/client/theme-default/components/VPMenuLink.vue'
import VPFlyout from 'vitepress/dist/client/theme-default/components/VPFlyout.vue'
const props = defineProps<{
versioningPlugin: { versions: string[], latestVersion: string }
screenMenu?: boolean
}>();

const router = useRouter();
const { site } = useData();

const currentVersion = computed(() => {
let version = props.versioningPlugin.latestVersion;

for (const v of props.versioningPlugin.versions) {
if (router.route.path.startsWith(`${site.value.base}${v}/`)) {
version = v;
break;
}
}

return version;
});

const isOpen = ref(false);
const toggle = () => {
isOpen.value = !isOpen.value;
};
</script>

<template>
<VPFlyout v-if="!screenMenu" class="VPVersionSwitcher" icon="vpi-versioning" :button="currentVersion"
:label="'Switch Version'">
<div class="items">
<VPMenuLink v-if="currentVersion != versioningPlugin.latestVersion" :item="{
text: versioningPlugin.latestVersion,
link: `/`,
}" />
<template v-for="version in versioningPlugin.versions" :key="version">
<VPMenuLink v-if="currentVersion != version" :item="{
text: version,
link: `/${version}/`,
}" />
</template>
</div>
</VPFlyout>
<div v-else class="VPScreenVersionSwitcher" :class="{ open: isOpen }">
<button class="button" aria-controls="navbar-group-version" :aria-expanded="isOpen" @click="toggle">
<span class="button-text"><span class="vpi-versioning icon" />Switch Version</span>
<span class="vpi-plus button-icon" />
</button>

<div id="navbar-group-version" class="items">
<VPMenuLink :item="{
text: versioningPlugin.latestVersion,
link: `/`,
}" />
<template v-for="version in versioningPlugin.versions" :key="version">
<VPMenuLink :item="{
text: version,
link: `/${version}/`,
}" />
</template>
</div>
</div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HN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48cGF0aCBkPSJNNyA3VjE3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48cGF0aCBkPSJNMTcgN1Y4QzE3IDEwLjUgMTUgMTEgMTUgMTFMOSAxM0M5IDEzIDcgMTMuNSA3IDE2VjE3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48L3N2Zz4=")
}
</style>

<style scoped>
.VPVersionSwitcher {
display: flex;
align-items: center;
}

.icon {
padding: 8px;
}

.title {
padding: 0 24px 0 12px;
line-height: 32px;
font-size: 14px;
font-weight: 700;
color: var(--vp-c-text-1);
}

.VPScreenVersionSwitcher {
border-bottom: 1px solid var(--vp-c-divider);
height: 48px;
overflow: hidden;
transition: border-color 0.5s;
}

.VPScreenVersionSwitcher .items {
visibility: hidden;
}

.VPScreenVersionSwitcher.open .items {
visibility: visible;
}

.VPScreenVersionSwitcher.open {
padding-bottom: 10px;
height: auto;
}

.VPScreenVersionSwitcher.open .button {
padding-bottom: 6px;
color: var(--vp-c-brand-1);
}

.VPScreenVersionSwitcher.open .button-icon {
/*rtl:ignore*/
transform: rotate(45deg);
}

.VPScreenVersionSwitcher button .icon {
margin-right: 8px;
}

.button {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 4px 11px 0;
width: 100%;
line-height: 24px;
font-size: 14px;
font-weight: 500;
color: var(--vp-c-text-1);
transition: color 0.25s;
}

.button:hover {
color: var(--vp-c-brand-1);
}

.button-icon {
transition: transform 0.25s;
}

.group:first-child {
padding-top: 0px;
}

.group+.group,
.group+.item {
padding-top: 4px;
}
</style>
Loading