View unanswered posts | View active topics It is currently Thu Apr 25, 2024 10:59 pm



Reply to topic  [ 1 post ] 
.htaccess docs. 
Author Message
pChart user
pChart user

Joined: Sat Jan 08, 2011 4:36 am
Posts: 4
Post .htaccess docs.
Wow, I'm really liking pCharts. It's exactly what I've been looking for. My site uses a ton of charts, and for almost two years I've been using a Flash based system. But I don't trust Flash, plus it isn't compatible with iDevices and therefore my site wasn't useful on iPhones and iPads. I tinkered around with HTML5, but that meant the use of JavaScript and clientside rendering, which meant differences in browsers could cause rendering problems, and the data points were not secure from scrapping bots. Anyway.

While setting up my site, which is fairly dynamic, I really needed to be concerned with browser/proxy caching. I do know you have a built in system to do some caching. But my site design is very advanced, and upwards of 5000 charts could potentially be used. So I needed something a little more robust when it comes to caching. So I did a ton of research and learned a bunch about using .htaccess files to shorten how long a browser would cache images. I have mine set to a half hour for any images in my charts folder. Maybe you, or one of your supporters, could document somewhere some basic .htaccess codes for browser caching purposes.

I also use a custom system of checking file modification dates, and then don't have the charts recreated unless they are older than a half hour. This is to keep server processing times down. Something a little like the code below.

Quote:
$filename = $chartimage;
if ((file_exists($filename)) && ((mktime() - filemtime($filename)) < 1800)) {
//echo "New. Do nothing.";
} else {
//echo "Old. Make new";
$myData = new pData();

// Bla Bla Bla pChart code goes here
}
$myPicture->Render("$chartimage");


Anyway, that keeps processing time within reason, while still having reasonably up to date charts. Just wanted share these ideas, and make the .htaccess documentation suggestion. I'd be happy do provide you a link to my site that you could use for demo purposes, but didn't want to place it on your forums without your permission.


Sat Jan 08, 2011 6:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron