Skip to content

Commit 4c0aaec

Browse files
authored
Merge pull request #155 from episerver/bugfix/CMS-46407-update-doc
Update instructions in sample site for graph webhooks revalidation
2 parents a6fa968 + 2a73a43 commit 4c0aaec

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

samples/graph-webhooks-cache-invalidation/README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,29 @@ Run `npm run webhook:create` and follow the instructions to create a webhook in
3838

3939
### 4. Create content
4040

41-
Go to your CMS and create a page in the path `/en/` (homepage for English language)
41+
Go to your CMS and create a page
4242

43-
### 5. Build and start the project
43+
### 5. Create an application
44+
45+
Go to your CMS → Settings → Applications. Click "Create application" In the dialog:
46+
47+
- In _Application Name_ write "webhooks_test"
48+
- Under _choose start page_ choose "from existing" and choose the page you created in the previous step.
49+
50+
Click create application and, in the list of applications, click the application you just created and go to "Hostnames". Click "Add Hostname". In the dialog:
51+
52+
- In _Hostname_ write the URL of your application, e.g. https://example.com.
53+
- Check the "Use a secure connection (HTTPS)" checkbox
54+
- In _Locale_ choose All
55+
56+
### 6. Build and start the project
4457

4558
Run `npm run build` and `npm start`
4659

4760
> [!Note]
4861
> The command `npm run dev` does not work because Next.js cache is disabled in dev mode
4962
50-
### 6. Test the cache
63+
### 7. Test the cache
5164

5265
Go to `<your project URL>/en`. You will see a page with the message:
5366

@@ -57,12 +70,12 @@ This page is generated and cached: 2025-10-03T12:42:40.453Z. 15 seconds ago
5770

5871
Refresh the page. You will see that the date is the same and that the seconds counter has _not_ restarted.
5972

60-
### 7. Trigger a cache revalidation
73+
### 8. Trigger a cache revalidation
6174

6275
Go to your CMS, make changes to the page `/en/` you created previously and publish them.
6376

6477
Go to `<your project URL>/en`. You will see that a different date and that the counter has restarted
6578

66-
### 8. Clean-up
79+
### 9. Clean-up
6780

6881
Run `npm run webhook:edit` and follow the instructions to delete the webhook that you don't need anymore.

samples/graph-webhooks-cache-invalidation/src/app/preview/page.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import React from 'react';
33
export default function Page() {
44
return (
55
<div>
6-
This sample site doesn&apos;t have Live Preview enabled. Go to{' '}
7-
<a href="/en/" target="_blank">
8-
/en
9-
</a>{' '}
10-
to see the actual page instead
6+
Preview mode doesn&apos;t cache content, to test the webhook cache
7+
invalidation, navigate to view mode by clicking{' '}
8+
<strong>Options &larr; View on website.</strong>
119
</div>
1210
);
1311
}

0 commit comments

Comments
 (0)