How to put a string at the end of all Urls via PHP (Codeigniter)

Asked

Viewed 109 times

3

I’m using the Codeigniter framework to develop a system. But in the company where they are using, the pages are not updating right, it is as if the cache is full page and only when I give an F5 it updates.

For example, has a screen where displays all users, if register a new user and return to this page it does not display the new user, only when I give a F5 is it updates and shows the new user.

I was able to solve the problem by placing a random string at the end of the URL as if it were a GET, so the browser understands that it is a new page and loads from scratch.

The problem is that there are many pages, there is some configuration in Codeigniter or a function in PHP that puts a string at the end of all Urls ?

Thus remaining: example.com? Fayrskuvu

Or does anyone know any other way to solve this problem ?

  • Is the Codeigniter cache not active? https://ellislab.com/codeigniter/user-guide/general/caching.html

  • This register is via AJAX?

  • @Renatotavares I think not, because it only happens in this place, in the other places I tested works normally. And in this place the same thing happens on other sites.

  • @Papacharlie registration is not done via AJAX. Registration is done via POST.

  • probably your server has a read delay, or some cache system. There is also the possibility that codeigniter is caching.

1 answer

2


To disable Codeigniter cache you can remove this tag from your project or reset the cache time:

$this->output->cache(0);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.