Surinam
Surinam
Can I pass the hash of the page on the server in the tag? `` And `document.head.querySelector('[name="cachep2p"]').content;` instead `document.documentElement.innerHTML`.
Oh, I think I realized that nonsense said. The hash is created from the data. In the end, I think the technology is not yet very ready.
No, many removed - comments, whitespace, quotes, min css, min js, etc. https://github.com/kangax/html-minifier ``` minify(html, { removeComments: true, removeCommentsFromCDATA: true, collapseWhitespace: true, collapseBooleanAttributes: true, removeRedundantAttributes: true, useShortDoctype: true, removeAttributeQuotes: true,...
Server code: ``` Hello WorldworldHello Worldvar cachep2p = new CacheP2P;console.log(document.documentElement.innerHTML); ``` **4bf59c219f7eb1278b15b82d25490e1130a1a7ff** Min server code === browser code (Ctrl+U - view-source:https://...): ``` Hello WorldworldHello Worldvar cachep2p=new CacheP2Pconsole.log(document.documentElement.innerHTML) ``` **c8e2912b026c5ccf34ba00339b3fe45ff0189a85** browser...
And if create hash from RequestJS - RequestJS code === browser code === min server code !== document.documentElement.innerHTML: ``` var request = require('request'); request('http://hello.com/', function (error, response, body) { console.log('error:',...
Good idea, @guerrerocarlos ``` var html = '...'; var cheerio = require('cheerio') var $ = cheerio.load(html); html = $('html').html(); ``` Do I have a bug in the browser? How can...
Oh, even having the same HTML-code in the browser and on the server, the hash is different. `console.log(document.documentElement.innerHTML)` === `$('html').html()` [CacheP2P] this page's security hash: **89c4ff2112efe2660b09e4881989237dcba2b88f** !== **6fc5e2c1af77ee5e511b729493c29fab50bb0bb9** This code...
Are there any thoughts about this error?
https://github.com/PixelsCommander/ViralJS I think ViralJS has similar functionality.
@goatandsheep this is fine, make ExpressJS middleware CacheP2P. ``` var CacheP2P = require('cachep2p'); var CacheP2PContainer = new CacheP2P(); myExpressApp.use(CacheP2PContainer.middleware); ```