NYCPHP Meetup

NYPHP.org

[joomla] Incorrect Cached URLs

Hans Zaunere lists at zaunere.com
Mon Apr 13 18:53:16 EDT 2009


Hello,

Caching it turned on for a site, whereby it's caching the templates for
obvious performance reasons.  Everything works fine, however there are some
occasional problems that crop up.

So if someone hits the correct domain, like www.something.com, and the cache
needs to be built out, everything is fine - the correct URL base is set,
etc. and the cache's links are built correctly.

However, the organization has been having some DNS issues, plus has the
server has HTTPS access and there is no named based virtual hosting on the
server.  Thus at times, strange HTTP hits with the wrong or no virtual host
come to the server, and at times HTTPS hits come to the server.  When the
cache times out, it's of course rebuilt, but now with the wrong URLs.

For the virtual host issue, I've had to add a couple of lines to the top of
the index.php file to pin the $_SERVER['HTTP_HOST'] to a consistent value
($live_site doesn't work by the way).

However, this issue is similarly problematic for HTTPS requests.  I could
redirect things, I suppose, but is there a better way?  Seems as though this
would be a common problem yet there's no elegant solution that's obvious.
Any help is greatly appreciated.

H






More information about the Joomla mailing list