I have tried a few tutorials and ways to implement caching in my Laravel application by adding middlewares, editing .htaccess, modifing headers and so on. Sadly nothing seems to work and I can’t find a way to configure the server on the App Platform to cache my images and everything else with Cloudflare.
My Cache-Control header is Private in every image request
Accept-Ranges:
bytes
Alt-Svc:
h3=":443"; ma=86400
Cache-Control:
private
Cf-Cache-Status:
BYPASS
Cf-Ray:
892ef02f4aa33132-SOF
Content-Length:
17733
Content-Type:
image/png
Date:
Thu, 13 Jun 2024 03:19:17 GMT
Etag:
"4545-11ef9b484c240"
Last-Modified:
Tue, 01 Jan 1980 00:00:01 GMT
Nel:
{"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Report-To:
{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=US0j8ShkRBdTvkxppLYfdlrr1ylryKteD9sF%2FQ%2FFXG7896C%2B%2FmoPZS5pyDtBeiH75E5ApVhVE9z7If9pp2Io9uC4V%2FScungiIG4Y%2BrRQjZivZ0Vm8dDb8WQkQnBcVGriTuHoJAqv328nUVF9oFY%3D"}],"group":"cf-nel","max_age":604800}
Server:
cloudflare
Vary:
Accept-Encoding
X-Do-App-Origin:
13fe4637-ea1a-4078-b991-409170ff0100
X-Do-Orig-Status:
200
For better understanding of the issue, you can visit https://thronetides.com/landing. I would really appreciate some help
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey!
After you’ve setup your Laravel middleware, have you also setup your Cloudflare settings?
As stated in this useful blog post here, you should be able to get this to work with the following setup:
On the Cloudflare side, as per the blog post, you would need to do the following:
Let me know how this goes!
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.