...
- Go to Page Rule
- Click Create Page Rule
- Enter your files directory like:
D7
Code Block *yourdomain.com/sites/all/themes*
D8
Code Block *yourdomain.com/themes*
- Enter the Following Settings.
- Browser cache expire TTL → 5 days (or whatever you want, make sure it is less then edge cache below)
- Cache Level → Cache Everything
- Edge Cache TTL → a month (or whatever you want)
You can test to see if this is working by running this command in your terminal
Code Block curl -svo /dev/null https://yoursite.com/sites/themes/themename/stuff.css
- If you see CF-Cache-Status: HIT in the header, then you are caching files.
Advanced Page Rules on the Pro plan and Up
If you have paid plan you would like to follow this document to setup advanced caching page rules
Make sure you are forcing https as described above. If your site is on Pantheon - make sure you setup all of the redirects to additional domains through CloudFlare and redirects are removed from settings.php otherwise you may run into infinite cache loop.
If your site is on Apache hosting (e. g. Acquia) then make sure you don't have httaccess redirects from additional domains and into https. And all of them are powered through CloudFlare UI.
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...