Hi, this is my first post to the DokuWiki User Forum.
I recently signed up with x10hosting and created a new account with Dokuwiki pre installed using Softaculous to install it.
Things were going fine until I started getting this error (a lot):
Resource Limit Is Reached
The website is temporarily unable to service your request as it exceeded resource limit. Please try again later.
I've managed to create a solution to fix the problem which would make a really nice plugin but looking at making plugins is overwhelming. I only heard about Dokuwiki a few days ago and I'm still getting used to it, so diving in and making a plugin is too much too soon.
What it does.
To get around the error I put all my images into a single image then extracted and displayed them via Query code.
To display an image I use
https://www.dokuwiki.org/plugin:canvas by Sahara Satoshi then wherever there's to be an image put
<canvas id1 width,height></canvas>
where width and height are the attributes of the image.
To extract the image I use
https://www.dokuwiki.org/plugin:inlinejs by Sahara Satoshi and put this code at the end of the page:
<JS>
(img = new Image()).src = "
http://example.com/lib/exe/fetch.php?media=map.png";
img.addEventListener("load", function() {
var offset = 5;
drawImage("#home", img, 1, 1, offset);
drawImage("#about", img, 1, 36, offset);
drawImage("#contact", img, 1, 58, offset);
});
function drawImage(id, img, sx, sy, os) {
for (var i = 1; jQuery((n = id+i.toString())).length > 0 ; i++) {
var c = jQuery(n)[0];
c.width += os; c.height += os;
c.getContext("2d").drawImage(img, sx, sy, c.width, c.height, os, os, c.width, c.height);
}
}
</JS>
What effect this has
Say your Dokuwiki page has 20 small images. Using this method you only have 1 image and the code extracts the 20 images from that. One nice thing is the browser caches this image so if it contains all the images for your website then loading one page loads all the media for all pages.
What would be really nice
Is if a plugin could change that messy method into something simple, like:
<imap myimg x, y, width, height></imap>
There's some minor issues at the moment that I haven't fixed, like using canvasses affects the formatting a bit.
What x10hosting have to say
x10hosting say that the problem is with
fetch.php, not with them. But I haven't found one single example of another person getting Resource Limit errors when using Dokuwiki. The problem can be reproduced with x10hosting with as few as or fewer than 5 images.