Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2006-06-15 14:49:56

Jordan
New Member
Registered: 2006-06-12
Posts: 6

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I cannot solve the problem itself. Please, give me advice.

Description of the problem:

Where I open the site-page, this plugin save the page in compressed format in file (jpc_82bb5f…). Where I reload my page, it load page-cached. It’s OK.

BUT… Where my latest cached file is older than X seconds (default 900), this pluging clean this cached file (size is done equal 0), but don’t delete it.

After this page do not caching and real-load while I’ll delete this cache-file.

Debug this page:

———

Status=OK – 200
Date=Thu, 15 Jun 2006 14:31:10 GMT
Server=Apache/1.3.33 (Win32) PHP/4.4.2
X-Powered-By=PHP/4.4.2
X-Cache=asy_jpcache v2 – file
X-CacheDebug-1=Cache scriptkey is set to /
X-CacheDebug-2=Cache varkey is set to GET=a:0:{}COOKIE=dcca48101505dd86b703689a604fe3c4
X-CacheDebug-3=Cachekey is set to 82bb5fd25d2ee63bb7b1241525d5df33
X-CacheDebug-4=Invalid content of cache-file z:\home\myhomepage.com\www/jpcache/cache/jpc_82bb5fd25d2ee63bb7b1241525d5df33
X-CacheDebug-5=No (valid) cachedata for 82bb5fd25d2ee63bb7b1241525d5df33
X-CacheDebug-6=Callback happened
X-CacheDebug-7=Writing cached data to storage
X-CacheDebug-8=Successfully wrote cachefile z:\home\myhomepage.com\www/jpcache/cache/jpc_82bb5fd25d2ee63bb7b1241525d5df33
Etag=“jpd—1572752606.20987”
Vary=Cookie
Content-Length=20987
Keep-Alive=timeout=15, max=78
Connection=Keep-Alive
Content-Type=text/html; charset=utf-8

—————-

I thought that, if the latest cached file is older than X seconds (default 900), this file must be deleted. I mistaken? If no, as this correct?

Offline

#62 2006-06-18 10:45:56

Jordan
New Member
Registered: 2006-06-12
Posts: 6

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Anybody, pleeeease, HELP me!!!

Offline

#63 2006-06-19 18:43:42

Jordan
New Member
Registered: 2006-06-12
Posts: 6

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I ask the foolish (difficult) question?

if (($cachedata[“jpcache_expire”]!=“0” && $cachedata[“jpcache_expire”]<=time()) OR ($force))
{
// Unlink file, we do not need to get a lock
$deleted = @unlink($filename);
if ($deleted)
{
jpcache_debug(“Successfully unlinked $filename”);
} else
{ jpcache_debug(“Failed to unlink $filename”);
}
}

Why it does not work?

P.S. I have a full rights of the access to file.

Last edited by Jordan (2006-06-19 18:47:29)

Offline

#64 2006-06-21 14:33:28

Jordan
New Member
Registered: 2006-06-12
Posts: 6

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Sencer. I was have to hack your plugin.

I have changed file jpcache-main.php.

—————————————————————————————————
<code>
// Can we read the cached data for this key ? if (jpcache_restore())
{
$temp = new TxpLogging();
jpcache_debug(“Cachedata for “.$GLOBALS[“jpcache_key”].” found, data restored”);
return true;
}
else
{
// No cache data (yet) or unable to read
jpcache_debug(“No (valid) cachedata for “.$GLOBALS[“jpcache_key”]);

$filename = $GLOBALS[“JPCACHE_DIR”].”/”.$GLOBALS[“JPCACHE_FILEPREFIX”].$GLOBALS[“jpcache_key”]; // This added

@unlink(“$filename”); // This added

return false; } </code> —————————————————————————————————

Now it works correctly. I hope that in following versions of plugin, this problem will is eliminated.

Offline

#65 2006-07-07 11:35:39

ice
New Member
Registered: 2006-06-26
Posts: 8

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Any ideas how partial caching could be achieved. We have a bit of code on every page that reads a cookie and sets a stylesheet depending on the user’s colour preference. The trouble is the URLs are the same for every user and so whoever sticks the page in the cache first dictates the colour of that page until it expires.

I had though that tacking a request parameter to every link but this is not really practical. Other things I have thought of are a mod-write rule to divert pages with the said cookie to a subdomain and make a slight mod to the cache plugin to ignore those subdomains (not even sure if that would work).

I am assuming that there would be no way to implement a cache_ignore tag that could be wrapped around the bits that you need devlivering dynamically.

Any other ideas appreciated.

Offline

#66 2006-07-07 12:53:03

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I am assuming that there would be no way to implement a cache_ignore tag that could be wrapped around the bits that you need devlivering dynamically.

That doesn’t make any sense for something that advertises itself very clearly as a “full-page-cache”. If you want partial caching try zem_cache.

We have a bit of code on every page that reads a cookie and sets a stylesheet depending on the user’s colour preference. The trouble is the URLs are the same for every user and so whoever sticks the page in the cache first dictates the colour of that page until it expires.

Take a look at function jpcache_varkey() in jcache-main.php. There is already some code that caches seperately for users with Cookies that start with txp_. It should be easy to adapt it to your needs.

Offline

#67 2006-07-07 14:07:44

ice
New Member
Registered: 2006-06-26
Posts: 8

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Sencer wrote:

That doesn’t make any sense for something that advertises itself very clearly as a “full-page-cache”. If you want partial caching try zem_cache.

Take a look at function jpcache_varkey() in jcache-main.php. There is already some code that caches seperately for users with Cookies that start with txp_. It should be easy to adapt it to your needs.

Cheers for that, and yes I agree it doesn’t make sense. guess I was just being lazy, but I’ll give that other stuff a try. thanks

Update, prefixed the cookies with txp_ and it works a treat. Thanks.

Last edited by ice (2006-07-07 14:16:00)

Offline

#68 2006-08-17 17:57:22

dotkraft
New Member
Registered: 2006-08-12
Posts: 9

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Just wanted to express my thanks for this wonderful plugin. Amazing! :)

Offline

#69 2006-09-03 16:03:24

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I have a site without any article tag (just a portfolio). Initially this plugin seemed to work, but after some minutes I get blank pages instead of cached ones. In a case I get messy character like:

x��Wao�.. (etc)

If i turn $JPCACHE_ON to 0, everything run fine, but it’s not cached! Is it a known behavior or what? Is it possible to cache pages that don’t contain any article tag?

Z

Last edited by Zanza (2006-09-03 16:05:56)

Offline

#70 2006-09-03 16:43:41

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

The article-tag has nothing to do with your problem, this plugin works on totally different level.

You can try disabling the gzip-related option in the jpcache config, for a wild guess.

Offline

#71 2006-09-03 23:42:16

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I tried, no luck. Same behavior. Uhm…

Z

Offline

#72 2006-09-17 17:31:21

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I have got the 0.9.8 working with my 4.0.3 and have one issue and one question:

Issue: “database unavailable” page seems to be cached
I had lost my database connection and received the error “database unavailable”. This did not go away when the database was available again. I cleared my Firefox 1.5.0.6 cache – no help. Only clearing the jpcache files through the admin plug-in helped.

If database is unavailable it would be nice to deliver the cached file until the database is available again and to not update the cached file with the “database unavailable” version.

Second include statement in index.php necessary?
The question is about the “include” statement after the “include … config.php” line. Is it necessary or only necessary when enabling TXP logging?


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB