r/PHPhelp • • Feb 24 '25

Restrict access to cached files CodeIgniter

I am caching some data using the output class in CodeIgniter 3.13. but the problem is that data is accessible to unauthenticated user due to how output class works (it first checks if the cached file exists and serves it and if it doesnt then it inits the controller and does the check access) Any idea how can I prevent this?

More context: the cached data is used for dashboards and data is refreshed every hour or two, also anyone can access that data when entering the url in the address bar and CodeIgniter serves the cached data... So if you type url/Dashboard/dashboardData , codeigniter would serve you the data if it is cached

1 Upvotes

3 comments sorted by

View all comments

Show parent comment