Welcome Guest, Not a member yet? Register   Sign In
Cache hash not unique with subdomains
#1

[eluser]a tired machine[/eluser]
Hello,

Our site uses the following scheme for searches:

category1.oursite.com/Location
category2.oursite.com/Location

which using htaccess map to:

/find/results/category1/Location
/find/results/category2/Location

Unfortunately, it appears that the above two get the same cache md5 hash, since the hash uses base_url (which for us is always http://www.oursite.com) to determine the domain of the page being loaded. This really limits the routability and use of subdomains with CodeIgniter.

I did a quick hack to our output library and changed to:

$uri = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];

But having hacked core files is obviously not ideal.
#2

[eluser]a tired machine[/eluser]
actually, using http_host is obviously not ideal since it relies on http headers, but -- creating the cache hash based on the resegmented codeigniter URI is better than how it currently is in codeigniter.




Theme © iAndrew 2016 - Forum software by © MyBB