Download spectrum/shared/imgix/getDefaultExpires.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 415 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/imgix/getDefaultExpires.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/imgix/getDefaultExpires.js
-
curl -L -o getDefaultExpires.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/imgix/getDefaultExpires.js
415 Bytes
| // @flow | |
| /* | |
| Expire images sent to the client at midnight each day (UTC). | |
| Expiration needs to be consistent across all images in order | |
| to preserve client-side caching abilities and to prevent checksum | |
| mismatches during SSR | |
| */ | |
| export const getDefaultExpires = () => { | |
| const date = new Date(); | |
| date.setHours(24); | |
| date.setMinutes(0); | |
| date.setSeconds(0); | |
| date.setMilliseconds(0); | |
| return date.getTime(); | |
| }; | |