Discussion:
[Mojolicious] LWP::UserAgent::Cached substitute?
e***@gmail.com
2018-11-21 01:44:29 UTC
Permalink
Hi folks,

First time poster.

I have some command line apps that use LWP with LWP::UserAgent::Cached for
the local file-based cache to get() and later parse pages. I need to use
this local page cache so that I don't hit the web server repeatedly for
unchanged pages. I was hoping to use Mojolicious, but prefer not to try to
re-implement this caching.

It doesn't appear that LWP::UserAgent::Cached would be usable with
Mojolicious, and don't see anything readily available as an alternative.

Any advice?
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Dan Book
2018-11-21 03:29:53 UTC
Permalink
I'm not sure why you say it wouldn't be usable with Mojolicious.
Mojolicious doesn't care what other modules you use. LWP won't be capable
of non-blocking queries like Mojo::UserAgent will of course, but that's
usually not important for the command line. If you want to do it with
Mojo::UserAgent try https://metacpan.org/pod/Mojo::UserAgent::Role::Cache.

-Dan
Post by e***@gmail.com
Hi folks,
First time poster.
I have some command line apps that use LWP with LWP::UserAgent::Cached
for the local file-based cache to get() and later parse pages. I need to
use this local page cache so that I don't hit the web server repeatedly for
unchanged pages. I was hoping to use Mojolicious, but prefer not to try
to re-implement this caching.
It doesn't appear that LWP::UserAgent::Cached would be usable with
Mojolicious, and don't see anything readily available as an alternative.
Any advice?
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
b***@keele.ac.uk
2018-11-21 15:05:32 UTC
Permalink
Post by e***@gmail.com
I have some command line apps that use LWP with LWP::UserAgent::Cached
for the local file-based cache to get() and later parse pages. I need to
use this local page cache so that I don't hit the web server repeatedly for
unchanged pages. I was hoping to use Mojolicious, but prefer not to try
to re-implement this caching.
Oooh, I was going to try file caching out this week, but got caught up
making slides for LPW.

Assuming that you're serving pages and want to set the Control-Cache
header, have a look at Mojolicious::Plugin::StaticCache
<https://metacpan.org/pod/Mojolicious::Plugin::StaticCache>

If you're using Mojo to fetch pages, Stefan Adams is looking for feedback
on his Mojo::DiskCache <https://github.com/s1037989/Mojo-DiskCache> on
github


I'd like to know how you get on. I'm trying to work it up for an Advent calendar post.

best,
Boyd
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Loading...