Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

beforeSend plugin #16

Open
knuhol opened this issue Jun 14, 2017 · 3 comments
Open

beforeSend plugin #16

knuhol opened this issue Jun 14, 2017 · 3 comments
Labels

Comments

@knuhol
Copy link

knuhol commented Jun 14, 2017

Is there any option how to use something like beforeSend(req, res, next) plugin from NodeJS prerender or is there any plan to add this feature?

I need to modify both request and response because:

  • I need to disable cache
  • I need to add some meta tags
  • I need to modify headers
@messense
Copy link
Member

chrome-prerender isn't designed as a library, it's an application. beforeSend isn't really applicable to an application. To support all the things you want, we need to redesign it to make it work as a library.

To disable cache, you can set environment var CACHE_BACKEND=dummy.

@knuhol
Copy link
Author

knuhol commented Jun 14, 2017

To disable cache, you can set environment var CACHE_BACKEND=dummy.

Thanks, but it doesn't work for me (still getting response 304 instead of 200).

@messense
Copy link
Member

@akarienta chrome-prerender will try to get the requested url's status code if possible. You got 304 means Chrome got 304 for that url.

https://github.com/bosondata/chrome-prerender/blob/master/prerender/chromerdp.py#L427

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants