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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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