Welcome Guest, Not a member yet? Register   Sign In
is this a cache problem?
#1

[eluser]scherman[/eluser]
Hi everyone, i have a serious problem with my backend. I think it is related with the cache.

I'll tell you an easy example of my problem, but you should know, my whole backend has the same problem.


For example, i have a CRUD of articles. Each article has a bool field (true=published; false=not published). My article's controller, render a list of all the articles. And next to the articles, you have a green button if the article is published (to unpublish it), and a red button if the article is unpublished (to publish it).

When i click on the red/green button, it redirects to this method:

(I use the WanWizard's Datamapper, but i think it won't be a problem tu understand)
Code:
public function publish($id, $state = true)
{
    if($id > 0)
    {
        $article = new Article();
        $article ->where('id', $id)->get();
        $article ->publicado = $state;
        $article ->save();
        redirect('backoffice/articles'); //return to the list again
    }
}

So, to the user experiencie, it should be: click the red button, the browser refreshs, and the button is green now.
But it doesn't work: i click the red button, the browser refreshs, and the button is still red.

If i check the database, i can see that it's worked! the article's state has changed. So, if i refresh the window (pressing F5), it load the new state.

It is very annoying to my clients who use my backend. Because, when they do some change, they have to refresh the window (pressing f5) to see the changes.


So, what can i do to solve it?

I will be very gratefull for your answers.
#2

[eluser]pbflash[/eluser]
Check your other thread about the same issue.
#3

[eluser]CroNiX[/eluser]
No need to double post, either.




Theme © iAndrew 2016 - Forum software by © MyBB