Page 4 of 6

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 9:44 pm
by teratyke
I build my cache using Xenu's Link Sleuth - have you tried that? I've been using it a lot less since Jay introduced the timed expiration feature.
Rob

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 10:41 pm
by Ampeter
Is there a way to know the url a cache file corresponds to by looking at its name?

It seems for some reason Link Sleuth is creating cache files with the same content but a different name than the ones created when you use your browser(even though I pasted the exact same url on both!), thats why I didn't notice any speed improvement with a link crawler... strange!

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 10:48 pm
by JAY6390
I see. They should be identical unless one's using seo urls, and the other isn't. Or one is using a different domain, ie one is www. and one isn't

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 10:58 pm
by MrTech
I was using Link Sleuth as well and all it did was show me how much extra work I have ahead of me fixing all the errors it found. However, when I check a page at random, it still doesn't show as cached. Just for good measure, I re-installed it just now, tried again and same results, no cache is created.

My www gets redirected directly to domain.com so when I check www.domain.com it does nothing, but if I check domain.com it works as expected, but again, none of the pages get cached which is too bad because this is an easy tool to use and it's free. Are you sure Link Sleuth works, you have actually checked the source of the page and seen the cached times show up?

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 11:04 pm
by Ampeter
JAY6390 wrote:I see. They should be identical unless one's using seo urls, and the other isn't. Or one is using a different domain, ie one is www. and one isn't
That's why I ask if there's a way of extracting the url from the file name (cache.ea2354f2lololol321etcetc -> http://www.mypage.com), as far as I can tell when I tell link sleuth to use http://www.mypage.com and when I access it via the browser it should be the same url but two cache files are created so there must be a difference somewhere! :S


MrTech wrote:I was using Link Sleuth as well and all it did was show me how much extra work I have ahead of me fixing all the errors it found. However, when I check a page at random, it still doesn't show as cached. Just for good measure, I re-installed it just now, tried again and same results, no cache is created.

My www gets redirected directly to domain.com so when I check http://www.domain.com it does nothing, but if I check domain.com it works as expected, but again, none of the pages get cached which is too bad because this is an easy tool to use and it's free. Are you sure Link Sleuth works, you have actually checked the source of the page and seen the cached times show up?
The first time I used it no cache files were generated, today I tried setting maximum depth at 0 and checked a single url and a cache file was created BUT apparently not with the same url you would get using a browser.

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 11:12 pm
by teratyke
I've got no visitors on my site a the moment :-[

I cleared the cache from the admin
Checked a specific url l looked at source - not cached.
re Checked the url l looked at source - cached - as you would expect.


I cleared the cache from the admin
ran link sleuth on that url
checked the url and source in a browser - it was cached.

That suggests it is working for me using link sleuth to build the cache.

I have noticed, and I can't quite put my finger on the problem, some inconsistencies as to when a cached page is loaded or not - for example it sometimes appears the cache is not working (in chrome) but if I switch over to Firefox all looks good -switch back to chrome and things seem to work - I know that doesn't make sense and I can't back it up with any evidence, but maybe it relates somehow.

A url is a url is a url regardless of browser or crawler, isn't it?

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 11:16 pm
by JAY6390
Open

Code: Select all

/vqmod/xml/caching.xml
Find

Code: Select all

                        $output .= '
<!-- WITHOUT CACHE: ' . $timer->stop() . ' -->'; 
change it to

Code: Select all

                        $output .= '
<!-- WITHOUT CACHE: ' . $timer->stop() . ' -->
<!-- KEY: ' . REQUEST_KEY . ' -->'; 
Then clear cache and when you next run it, it will add the key on each page

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Thu May 17, 2012 11:55 pm
by Ampeter
teratyke wrote: I cleared the cache from the admin
ran link sleuth on that url
checked the url and source in a browser - it was cached.
Are you using seo urls? I'm trying to think what could I be doing wrong :(

JAY6390 wrote:Open

Code: Select all

/vqmod/xml/caching.xml
Find

Code: Select all

                        $output .= '
<!-- WITHOUT CACHE: ' . $timer->stop() . ' -->';  
change it to

Code: Select all

                        $output .= '
<!-- WITHOUT CACHE: ' . $timer->stop() . ' -->
<!-- KEY: ' . REQUEST_KEY . ' -->';  
Then clear cache and when you next run it, it will add the key on each page
Is there a way to go from key->url? Checking the key from the source doesnt help as I can't access the cached pages created by the crawler as I don't know their urls! :D

Thanks anyways.

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Fri May 18, 2012 12:05 am
by JAY6390
The key is essentially a hash of a number of parameters, so you can't reverse them unfortunately

Instead, what you can do is open

Code: Select all

/pagecache/caching.php
find

Code: Select all

define('REQUEST_KEY', $requestKey); 
at the bottom. After it, add

Code: Select all

define('REQUEST_KEY_FULL', $key); 
Then change the REQUEST_KEY in the previous post code to REQUEST_KEY_FULL. That will give you the exact data thats collected to generate the hash. Note that it will be visible to visitors too, so you'll need to remove it again once you've finished testing

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Fri May 18, 2012 12:16 am
by Ampeter
That worked! finally! :D

The difference was in language/currency. Link Sleuth links were using "en/usd" but my store has another default language and uses euros.

Now to find a way to fix that, but at least I know where's the problem! :crazy:

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Fri May 18, 2012 12:22 am
by JAY6390
You can set the default language pretty easily, you just need to open
/pagecache/caching.php and find

Code: Select all

$language = (empty($_SESSION['language']) || !is_string($_SESSION['language'])) ? 'en' : $_SESSION['language'];
changing the 'en' to your language
and changing

Code: Select all

$currency = (empty($_SESSION['currency']) || !is_string($_SESSION['currency'])) ? 'usd' : $_SESSION['currency'];
to have eur instead of usd

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Fri May 18, 2012 8:07 pm
by Ampeter
JAY6390 wrote:You can set the default language pretty easily, you just need to open
/pagecache/caching.php and find

Code: Select all

$language = (empty($_SESSION['language']) || !is_string($_SESSION['language'])) ? 'en' : $_SESSION['language'];
changing the 'en' to your language
and changing

Code: Select all

$currency = (empty($_SESSION['currency']) || !is_string($_SESSION['currency'])) ? 'usd' : $_SESSION['currency'];
to have eur instead of usd

Yeah! that's what I ended up doing, should've checked the thread before wasting an hour trying different things :D Finally I can use a crawler to generate the cache!

Thanks for all the help! where can I sign up for your fan club? :joker:

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Fri May 18, 2012 8:09 pm
by JAY6390
If you just get some pom poms and cheer "Jay Jay, he's the best" that will do for me :D

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Sat May 19, 2012 5:45 am
by MrTech
Ok so I'm following your discussion and trying to apply the changes but I still get the same results, no cache. I have English as default but CAD as the currency so I opened caching.php and changed line 149 $currency from 'usd' to 'cad'.

Cleared the cache, ran link sleuth again and still no cache shows up on the page?!? Should I apply the 'key' mods suggested above as well? What step did I miss?

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Sat May 19, 2012 5:50 am
by JAY6390
Hi MrTech

Apply the key mods above to see what the difference is in the keys being applied yes. That's the only way to know for sure what the difference is

Kind regards
Jay

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Sat May 19, 2012 4:53 pm
by Ampeter
MrTech wrote:Ok so I'm following your discussion and trying to apply the changes but I still get the same results, no cache. I have English as default but CAD as the currency so I opened caching.php and changed line 149 $currency from 'usd' to 'cad'.

Cleared the cache, ran link sleuth again and still no cache shows up on the page?!? Should I apply the 'key' mods suggested above as well? What step did I miss?
Try this:

-Clear your pagecache/cachefiles folder

-Rename Xenu.ini to Xenu.ini.bak in your Link Sleuth folder (so a new one is created with default settings).

-Start Xenu.exe and set on options "Maximum depth" at 0.

-Click Control+n to check a new url. Dont forget to add the final "/"!! -> "www.yoursite.com/" Otherwise no cache will be generated using depth 0.

-Check your pagecache/cachefiles folder (from FTP! that's the only way to know for sure if any cache is being created at all)

That is what I was doing and it worked. Good luck! ;)


BTW: I found another more powerful link checker: http://linkchecker.sourceforge.net/

It also shows you the parent url (very useful!) and let's you use regex to limit searches, plus you can use the gui or run it automatically using the command line.

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Sat May 19, 2012 7:10 pm
by teratyke
Ampeter wrote: BTW: I found another more powerful link checker: http://linkchecker.sourceforge.net/
Thanks for that - looks excellent - command line too, so I should be able to schedule a cache rebuild during the night.


Jay, anyone,
Is there an explanation for this behaviour, or could someone confirm what I am seeing?
If I visit my site using chrome, I don't seem to get the cached version, if I use firefox I do.
Screen shot attached you can see the comments are not there in the chrome view-source.
It didn't do this before, but I can't see how the browser could effect this. It occurred to me that it is using the cache, but chrome is removing the comments from the bottom of the source, is that feasible?


(scroll right to view source)

Thanks
Rob

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Sat May 19, 2012 7:13 pm
by JAY6390
Hi Rob

That will be the 70 items in your shopping basket ;)
There's no caching if items are in your basket or you are logged in as a customer

Kind regards
Jay

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Sat May 19, 2012 7:18 pm
by teratyke
oh yeah. :-[ Clearly I need more coffee and not try to do any work at a weekend. :drunk:
Such a clever mod.

Re: [RELEASED][1.4.8 - 1.5.X]Open Cart Page Cache

Posted: Sat May 19, 2012 7:20 pm
by JAY6390
haha agree, go put your feet up :)