Welcome Guest, Not a member yet? Register   Sign In
Cache problem
#1

[eluser]Moddi[/eluser]
I have got complain that my site is demanding information from a different database too much so what i did was to add this code:

Code:
$this->output->cache(n);
Where N i have currently 1000, so it will only update every 16 hours

But the problem is that now when i try to search for tyres its only showing me the cached view, not showing me the correct value.

Here's the site

Now try to change tyre size, from 195 / 65 / 15 to anything of the options available. Look whats happening, it still showing the cached view and not loading the correct information/site.

Also added the code to cart controller, and its doing the same, showing incorrect value.

Is there a better way to make this work?

EDIT: I had to remove the cache code cause its blocking customers to search and u cant see it live anymore!
#2

[eluser]farinspace[/eluser]
CI will write cache files based off of the URI string ... each cache file will be unique to the URI string (see "system/libraries/Output.php" line 309-313) ...

with that said you can make your search redirect to unique URLs such as:

http://www.dack4.se/search/size/195/65/15
http://www.dack4.se/search/size/205/65/15
http://www.dack4.se/search/size/215/70/16

Then CI should create individual cache files for each search ...
#3

[eluser]Moddi[/eluser]
how can i do that? im not really a programmer, also when u search, its not searching thru my database, its searching thru a different database that i dont have access to. Dunno if it matters or not but im guessing it does.
#4

[eluser]farinspace[/eluser]
it shouldn't matter ...

a request such as this:

http://www.dack4.se/search/size/195/65/15

would go to your "search" controller > "size" method/function and the 195, 65, 15 are passed in as variables to the "size" method/function ... from there you can do what ever search you want with those variables ...

see: http://ellislab.com/codeigniter/user-gui...llers.html




Theme © iAndrew 2016 - Forum software by © MyBB