Cache problem |
[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); 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!
[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 ...
[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.
[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 |
Welcome Guest, Not a member yet? Register Sign In |