1

I have a couple of things I'm working on, namely a page that issues five or six cURL requests and processing content on them.

I'm working with CodeIgniter on a LAMP stack but am open to other options. Naturally I would prefer to not rewrite the application.

I would like to know if there are any ready-made / easily learned caching methods. Primarily I'd like to check if the page has changed since I last scrapped it. If it has, redownload and present. If it hasn't, serve up a cached copy.

1 Answer 1

2

Have a go with my Cache library.

Combine that with my cURL library and you'd have some very simple syntax.

// un-cached
$this->load->library('curl');
echo $this->curl->simple_get('http://example.com/');

// cached
$this->load->library('cache');
echo $this->cache->library('curl', 'simple_get', array('http://example.com/'), 120);

That'll cache your page request for two minutes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.