PythonicCafe / prerender-plugin-fscache

File system cache plugin for prerender.
GNU Lesser General Public License v3.0
2 stars 0 forks source link

Once cached, cached content is not served upon retrieval #1

Open technicalbirdVayuz opened 2 months ago

technicalbirdVayuz commented 2 months ago

Similar to https://github.com/PythonicCafe/dokku-prerender/issues/3

Problem: Maybe corrupted cache, https://github.com/PythonicCafe/dokku-prerender/issues/3#issuecomment-2025567619

Logs:

2024-04-04T11:35:55.648Z getting https://corract.com/feed/post/keyword-filters-in-google-search-result-page
2024-04-04T11:35:55.859Z Initial request to https://corract.com/feed/post/keyword-filters-in-google-search-result-
page
2024-04-04T11:35:55.947Z Initial response from https://corract.com/feed/post/keyword-filters-in-google-search-resu
lt-page with status code 200
2024-04-04T11:35:56.009Z Initial request finished https://corract.com/feed/post/keyword-filters-in-google-search-r
esult-page
2024-04-04T11:35:58.605Z [fscache] Caching https://corract.com/feed/post/keyword-filters-in-google-search-result-p
age to /app/cache/a9/a9dc07595713503dece7cbfcbec3fa15097fcc8c
2024-04-04T11:35:58.640Z got 200 in 2992ms for https://corract.com/feed/post/keyword-filters-in-google-search-resu
lt-page
2024-04-04T11:36:28.175Z getting https://corract.com/feed/post/keyword-filters-in-google-search-result-page
2024-04-04T11:36:28.181Z [fscache] Serving https://corract.com/feed/post/keyword-filters-in-google-search-result-p
age from /app/cache/a9/a9dc07595713503dece7cbfcbec3fa15097fcc8c
TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["access-control-allow-origin"]
    at ServerResponse.setHeader (node:_http_outgoing:706:3)
    at newRes.setHeader (/app/node_modules/prerender/lib/server.js:375:8)
    at /app/node_modules/prerender-plugin-fscache/index.js:284:11
    at Array.forEach (<anonymous>)
    at Object.requestReceived (/app/node_modules/prerender-plugin-fscache/index.js:283:44) {
  code: 'ERR_INVALID_CHAR'
}
2024-04-04T11:36:28.278Z getting https://corract.com/feed/post/keyword-filters-in-google-search-result-page
2024-04-04T11:36:28.281Z [fscache] Serving https://corract.com/feed/post/keyword-filters-in-google-search-result-p
age from /app/cache/a9/a9dc07595713503dece7cbfcbec3fa15097fcc8c
TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["access-control-allow-origin"]
    at ServerResponse.setHeader (node:_http_outgoing:706:3)
    at newRes.setHeader (/app/node_modules/prerender/lib/server.js:375:8)
    at /app/node_modules/prerender-plugin-fscache/index.js:284:11
    at Array.forEach (<anonymous>)
    at Object.requestReceived (/app/node_modules/prerender-plugin-fscache/index.js:283:44) {
  code: 'ERR_INVALID_CHAR'
}
2024-04-04T11:36:38.176Z Plugin event requestReceived timed out (10s), layer index: 4, url: /https://corract.com/f
eed/post/keyword-filters-in-google-search-result-page
2024-04-04T11:36:38.279Z Plugin event requestReceived timed out (10s), layer index: 4, url: /https://corract.com/f
eed/post/keyword-filters-in-google-search-result-page
technicalbirdVayuz commented 2 months ago

Had to remove fscache from the .env file, using https://github.com/PythonicCafe/dokku-prerender, Please suggest the solution for this @turicas