parlays
asked on
Advice for a Content Management System that uses a Publishing Mechanism that enables caching dynamic content?
Hello everyone,
Looking for a method to use dynamic content from either a database or XML source that is retrieved using PHP, but I want the content to cache if it has not changed at all. Basically, I don't the PHP to keep on making requests to the database if the content has been the same for the last hour.
What methods or solutions do you recommend for this? I've heard a reverse proxy cache works well, but I heard some sort of publishing mechanism works better.
Looking for a method to use dynamic content from either a database or XML source that is retrieved using PHP, but I want the content to cache if it has not changed at all. Basically, I don't the PHP to keep on making requests to the database if the content has been the same for the last hour.
What methods or solutions do you recommend for this? I've heard a reverse proxy cache works well, but I heard some sort of publishing mechanism works better.
ASKER
Option #2 sounds interesting, can you please elaborate?
ASKER
I'm curious where the cache would be stored? Inside an HTML document, and the cache controlled by the server? I don't fully grasp how it works yet, thanks for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry to follow up again, what do you mean when you say:
"Server gets report.php and simply echos from a HTML file."
Somebody requests the php file, and it the information comes from the HTML, so the HTML is created from cron (the scheduling system), interesting. Now that I type it, I start to understand, haha. Is cron hard to use, how do I populate the HTML file with cron? (I was going to ask if it is better to use XML but I figure PHP will echo HTML much faster)... thanks!
"Server gets report.php and simply echos from a HTML file."
Somebody requests the php file, and it the information comes from the HTML, so the HTML is created from cron (the scheduling system), interesting. Now that I type it, I start to understand, haha. Is cron hard to use, how do I populate the HTML file with cron? (I was going to ask if it is better to use XML but I figure PHP will echo HTML much faster)... thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent stuff, thank you so much.
One last quick question. For your option #1, what mechanism would i use to trigger update/creation of cache when data change?
One last quick question. For your option #1, what mechanism would i use to trigger update/creation of cache when data change?
well I just followed what I was reading, and I gave my input we are however different users not the same guy.
Anyway the cron job you can have your host set up for you, or you can set it up through cron through cpanel. There's many methods on implementing this, but it mostly depends on the host, I would talk to your host if you are not under cpanel or something along those lines.
Anyway the cron job you can have your host set up for you, or you can set it up through cron through cpanel. There's many methods on implementing this, but it mostly depends on the host, I would talk to your host if you are not under cpanel or something along those lines.
ASKER
I am using Plesk right now on a Virtual Private Server, in the PLESK control panel there is an option for schedule tasks, maybe that is cron or similar. I will research this matter more, thanks for your help Azurewave, I didn't realize you were another person, lol.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There are 2 ways that I would think are relevant.
1 - Trigger the creation/update of the cache when data changes. This is the way to go if your data is changed VERY infrequently.
2 - Regularly expire the cache and refresh it automatically. If you have rapidly changing data then this is the way to go.
If you can tell me which of these 2 scenarios fit your data, I can expand on them further.