Welcome Guest, Not a member yet? Register   Sign In
Caching other pages than the current Controller/View
#1

Hello, this is my first post here. I searched for this topic but did not find an answer to my problem.

I am building a website with registration/login, where users can create profiles and update them. There is a controller to show the profile update form, and a controller for the frontend profile page that other site users see when they look up that person.

I want to set up something similar to a WordPress plugin called WP Super Cache, where every time you update the profile form, the cache gets regenerated for the PUBLIC page.

However, from the documentation I have read, it seems you can only call the cache driver's function for the CURRENT controller/page (the profile update form in this case). What I want to cache is the public page, not the update form.

The only solution I see for this, is to create a table in my MYSQL database with cache dumping requests for specific URLs. When a user updates his profile, a record is created in that table storing the URL of the public page.

Then when the public page is visited, the controller would first check that table and if a request is found there, delete the cache and regenerate it before handing it out to the browser.

Is there any easier way to do this? (Will that even work if the page is cached??)
Reply


Messages In This Thread
Caching other pages than the current Controller/View - by deltatangodt - 08-09-2018, 10:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB