How to host a large CSS stylesheet file in my server?
For example, a 800 KB fonts.css file downloaded from typography.com?
Create a new eSpace to host the large CSS resource.
Since resources are uploaded each time you publish an eSpace, it's better to keep big resources outside the eSpaces that change often.
Here are the steps:
- Create a new empty eSpace (e.g. Fonts).
- Under tab Data, section Resources, right-click and select Import Resource. Select the fonts.css file you've downloaded.
- In the properties of the resource, make sure you select Deploy to Target Directory as the Deploy Action (see screenshot below).
- Publish the eSpace.
- On your current eSpace, change your link tag URL to point to the new space and resource. For example: <link type="text/css" rel="stylesheet" href="/Fonts/fonts.css" />.
The first browser request will still take some time, because it's a big file. But the browser should cache its contents in the subsequent requests.