Download next.js/test/e2e/getserversideprops/app/pages/custom-cache.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 250 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/getserversideprops/app/pages/custom-cache.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/getserversideprops/app/pages/custom-cache.js
-
curl -L -o custom-cache.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/getserversideprops/app/pages/custom-cache.js
250 Bytes
| import React from 'react' | |
| export async function getServerSideProps({ res }) { | |
| res.setHeader('Cache-Control', 'public, max-age=3600') | |
| return { | |
| props: { world: 'world' }, | |
| } | |
| } | |
| export default ({ world }) => { | |
| return <p>hello: {world}</p> | |
| } | |