Comments (2)
Thanks for using URL pages!
This is very interesting, and totally possible that the "published" URLs are longer. While I was working on Link Lock, I realized that oddities with atob
and btoa
in JavaScript that necessitated calls to encodeURIComponent
could be avoided by using my own implementation of base64 encoding. These calls to encodeURIComponent
are most likely a factor in the URL length disparity.
Since releasing Link Lock a little while ago, I have been thinking about the best way to remove unnecessary URI encoding while preserving backwards compatibility. I'm thinking doing of something like I do in the Link Lock code, where the "published version" of URLs have a base64-encoded JSON object in the hash, which contains version information in addition to page data. That way if the decoder fails to decode valid JSON, it assumes it's using the original version. Likewise, future versions can have their own decoding schemes.
This is good motivation to give the code a much-needed tune-up. I will leave this issue open for now and investigate further over the weekend. Hopefully this resolves the issue of published URLs being longer. Thanks again for pointing this out, it is very helpful!
from urlpages.
Finally got around to pushing the fixes to make the links slightly shorter. While I was at it, I restructured the code as a versioned API so that in the future I can add support for page compression, as well as any other features I have not thought of yet.
In most cases, the updated code seems to have reduced overall URL size. For example, a sampling of the pages in the examples
directory shows:
$ du -h examples/*.html
348K examples/embed-page-old.html
328K examples/embed-page.html
256K examples/food-blog-old.html
112K examples/food-blog.html
372K examples/nyt-old.html
268K examples/nyt.html
252K examples/project-page-old.html
268K examples/project-page.html
Note that the project-page.html
URL is larger because GitHub has changed their interface since I made the original link.
I am now closing this issue. Thanks again!
from urlpages.
Related Issues (20)
- Emojis in HTML Body break URL Pages Editor HOT 2
- Optimize compression by utilizing the Huffman algorithm HOT 1
- Missing sections in ReadMe.md leads to open questions HOT 5
- Some Suggestions HOT 5
- maybe inspired by itty-bitty and TinyEditor? HOT 1
- Blocked by anti-malware: "Malicious URL - Phishing" HOT 6
- Main page is down? HOT 2
- Password protection
- History is wrecked HOT 2
- Add Markdown vs HTML+CSS toggle? HOT 1
- URL contains wrong server HOT 1
- does this url support passing varibles with the links HOT 2
- Preprocessors support? HOT 3
- multi-page sites (tree hierarchy)?? HOT 4
- Feel free to link to my similar projects HOT 1
- Switch to base65536 HOT 9
- UI Design HOT 2
- Syntax Highlighting for HTML/CSS/JS textareas HOT 1
- Safari Issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urlpages.