Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Static sites w/ GS - speed & security. "GetSimpler"
#26
Just say if you require ftp uploads instead of the solution I made that just requires the plugin to be in same dir structure on server.

can later look to do upload of theme files also if required. dunno if will be wise to do upload of uploads folders
tx. but can do.

johannes
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply
#27
BTW, has anyone here watched their webserver melt under the "Slashdot effect" before?

I have, hence my interest in being able to make things fast and light - being able to handle 10-100x as many requests per second is a useful feature :-)
Reply
#28
Johannes - thanks for offering FTP, but I personally don't use it because of the security risks involved with FTP vs. SFTP.

Generation of a 'ready-to-upload to server' directory of HTML etc is all I seek :-)

(Others may have different opinions though - I can imagine some users who have a safe connection to their FTP server e.g. on an internal wired LAN)
Reply
#29
the_amusing_cow Wrote:Johannes - thanks for offering FTP, but I personally don't use it because of the security risks involved with FTP vs. SFTP.

Generation of a 'ready-to-upload to server' directory of HTML etc is all I seek :-)

(Others may have different opinions though - I can imagine some users who have a safe connection to their FTP server e.g. on an internal wired LAN)


Can look at SFTP, but first have to work.. will look tonight. but if this solution is working for you, then lets stay with it for now. can add uploading the active theme maybe later on seperate button, that can make sense, just incase you start using different theme.

tx

johannes
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply
#30
Hi again -

Just tried it, seems to work pretty well!

Some notes:

- The directory "plugins/config/_global/dominion_static" needs to be created if it doesn't exist already, and it needs to be set writeable. Perhaps your program can do that automatically? Or a default directory structure can be included in the distribution, for the user to manually set writeable.

- The directory "dominion_static_pages" needs to be set writeable.

--- Possible program/distribution improvement ideas ---

- The directory "plugins/config/_global/dominion_static" needs to be created if it doesn't exist already, and it needs to be set writeable: --> Perhaps your program can do that automatically? Or a default directory structure can be included in the distribution, for the user to manually set writeable. Or, include this information on the plugin setup page in a red highlight warning box: test for the directory and test that it's writeable, and display the warning if they haven't set it up right.

- copying over the theme files / dependencies would be really nice. It saves the user some extra steps and makes it more likely they'll use this plugin to do all their work for them.

- "dominion_static_pages": It may also be helpful to auto-wipe this directory before generating the new pages in there, so that old deleted pages don't also get copied along (which is the current behaviour).

- The / could be appended automatically to the servername, with the default being 'not to include the /'. e.g. http://cow.com//test.html will work if the person already included the '/' in the variable name, and http://cow.com/test.html will work, whereas http://cow.comtest.html won't work... do you see what I mean?

- The plugin doesn't work with second-level directories if someone is using the "I18N Navigation" plugin. Many people don't use it, so this isn't a big problem. Supporting this would require:
- detect the use of the plugin
- iterate across the 2nd, 3rd level directory structure etc.
- Generate directories and pages with the correct naming system (e.g. they are placed as "level1/level2/level3page")

- there are some test files in the zip from your own tests, just so you know...

- Your plugin seems to work great with e.g. the markdown plugin, because you're dragging the pages off the server via HTTP. :-)

Works pretty well for a 0.2a release and will solve a problem for many GS sites, I think! Thanks again :-)

T.A.C.
Reply
#31
the_amusing_cow Wrote:- The directory "plugins/config/_global/dominion_static" needs to be created if it doesn't exist already, and it needs to be set writeable. Perhaps your program can do that automatically? Or a default directory structure can be included in the distribution, for the user to manually set writeable.

- The directory "dominion_static_pages" needs to be set writeable.

Actually I do that already, just dont make it writable, will add that permissions to the command.


the_amusing_cow Wrote:- copying over the theme files / dependencies would be really nice. It saves the user some extra steps and makes it more likely they'll use this plugin to do all their work for them.

Jip, also thinks this will be easier, can pull the theme from the active theme dir. Will added that, was more a rushed job than anything else, just to get the bases out there.

the_amusing_cow Wrote:- "dominion_static_pages": It may also be helpful to auto-wipe this directory before generating the new pages in there, so that old deleted pages don't also get copied along (which is the current behaviour).

Good point. I will add this, I actually also want to add a password to the system where you create a password on your install and you create one on the server in a textfile (this will have to be manual as the idea is that the server does not have a GS install to get to the admins screens) and only files with the correct password will be processed, just for that little extra security.

the_amusing_cow Wrote:- The / could be appended automatically to the servername, with the default being 'not to include the /'. e.g. http://cow.com//test.html will work if the person already included the '/' in the variable name, and http://cow.com/test.html will work, whereas http://cow.comtest.html won't work... do you see what I mean?

Yes, was part of the rush, sorry. was easier to add the text 'add / at end' where you input the url. but will add with next release thanks

the_amusing_cow Wrote:- The plugin doesn't work with second-level directories if someone is using the "I18N Navigation" plugin. Many people don't use it, so this isn't a big problem. Supporting this would require:
- detect the use of the plugin
- iterate across the 2nd, 3rd level directory structure etc.
- Generate directories and pages with the correct naming system (e.g. they are placed as "level1/level2/level3page")

Will look into this, not suppose to be a problem to add, dont know the plugin really, but will add and test and then add the functionallity maybe now, maybe later.

the_amusing_cow Wrote:- there are some test files in the zip from your own tests, just so you know...
Oops Big Grin , tx will remove. (late night coding)

the_amusing_cow Wrote:- Your plugin seems to work great with e.g. the markdown plugin, because you're dragging the pages off the server via HTTP. :-)

Works pretty well for a 0.2a release and will solve a problem for many GS sites, I think! Thanks again :-)

T.A.C.


glad to hear, will try and get something out today. First buy some food !! Big Grin

Cheers

Johannes
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply
#32
Johannes,

Re: uploading button for theme separately; it's probably simpler to have the plugin generate 'a complete working set of files for a complete static site, including theme', with a single 'upload whole site option'... the size of the theme is probably tiny anyway. Rather than generate them both separately.

If the person has access to run the script, they have already authenticated as an admin I think? A second pass might be overkill... if implemented insecurely it could even lead people to accidentally expose their main password (if they chose to use the same pass for both).

The advantage of simpler mode of working, and simpler set of plugin options for users, probably outweigh saving 0.001 seconds of site upload time :-)
Reply
#33
"- The plugin doesn't work with second-level directories if someone is using the "I18N Navigation" plugin. Many people don't use it, so this isn't a big problem. Supporting this would require:
- detect the use of the plugin
- iterate across the 2nd, 3rd level directory structure etc.
- Generate directories and pages with the correct naming system (e.g. they are placed as "level1/level2/level3page")"

OK, I took a look into this. The plugin appears to cheat slightly, so that e.g.

http://www.site.com/gallery/photos1
will take you to the same page as
http://www.site.com/photos1

In other words, if you have generated a static page for every GS page without worrying about the i18n plugin, you've already got all the subpages from the i18Plugin anyway. The i18n thing is just presenting them in a clever way.

The only thing that needs to be done then is:

per-page in GS: move the already generated page into the right directory so that the links on the page work correctly. This involves creating the directories for the parents though. e.g. create 'gallery' in the example above and move/name the page accordingly.



However! A lazy alternative that might just work is:

Iterate over all the static pages. For each page, search and replace the <A> tags with a regular expression.

HREF="http://site1.com/football/uk/man-united/" is transformed to
HREF="http://site1.com/man-united/"

Two regular expressions should do it, something like

1. (z) = HREF\=".*" (make 'z' equal to the URL inside the quote marks)

2. (a,b,c) = (//.*/)(.*/)*(.*^) (feed 'z' into this regular expression to chop it into three bits)

where 'a' gives you //site1.com/
'b' gives you football/uk/
'c' gives you man-united/^ (where ^ is the end of string character for regexs in your language)

then replace z with a+c //site1.com/man-united/ .... tada! Sounds tricky but it's a 1 or 2 line jobby if you know your language. I could do it in PERL, but I've not worked in PHP before.
Reply
#34
the_amusing_cow Wrote:"- The plugin doesn't work with second-level directories if someone is using the "I18N Navigation" plugin. Many people don't use it, so this isn't a big problem. Supporting this would require:
- detect the use of the plugin
- iterate across the 2nd, 3rd level directory structure etc.
- Generate directories and pages with the correct naming system (e.g. they are placed as "level1/level2/level3page")"

OK, I took a look into this. The plugin appears to cheat slightly, so that e.g.

http://www.site.com/gallery/photos1
will take you to the same page as
http://www.site.com/photos1

will look at, sorry got sidetracked, wife wanted me to play computer game with her. now finished Big Grin
weee .. codetime !
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply
#35
the_amusing_cow Wrote:Two regular expressions should do it, something like
1.     (z)  =    HREF\=".*"       (make 'z' equal to the URL inside the quote marks)
2.     (a,b,c) =  (//.*/)(.*/)*(.*^)       (feed 'z' into this regular expression to chop it into three bits)
where 'a' gives you    //site1.com/
'b' gives you              football/uk/
'c' gives you              man-united/^      (where ^ is the end of string character for regexs in your language)


Ja have been playing with regex this week actually, for other reasons, making plugin browser for GS, pulls all plugins from plugin webpage, want it to give option to install from inside GS and update as required. but that is other story. Anyways.. Will look at , just have to make sure it is urls of the target(local site url). and not replace external stuff. thus will make little more custum, but not a problem. I can also just run into the directories and create each page as is and keep the dir structure and move that over as needed. Will see, that way all is almost a mirror of remote.

tx

johannes
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply
#36
Connie Wrote:I'd like to discuss the cons and pros of such a scenario, so that I might understand that request better: 1) I doubt that a small static site will load faster than a small xml site ... 6 HTML files <=> 6 XML files, will there be a noticeable difference?
Basically, we are talking about page caching here. Without page caching: Browser requests page --> PHP (parses XML files) --> output HTML (around 300 - 500 millisecond delay) With page caching: Browser requests page --> .html files (around 20 - 30 millisecond delay, which is MUCH faster)
Quote: 2) in such a scenario: admin-area will be gone, plugins will still work? how to configure image galleries, add images etc.?
These caching plugins usually do not cache admin pages.
Quote: 3) how to update pages? Start the old story again, with editing offline and upload ?
Once a page is updates, the cache is cleared.
Make your GS site fly with SpeedySparrow cloud hosting!
Reply
#37
Hi there. Please see how version 0.3 works

http://get-simple.info/forum/topic/2273/...es-plugin/

made a few changes to make it easier.

tested with I18N multi level menus and seemed to work with no changes really.

Let me know if any issues..
tx

Johannes
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply
#38
Thanks Johannes! I am looking forward to trying it out, though it may be a couple of days before I get the time to play with my site again :-)
Reply
#39
I love static pages too.
I have a question. If the website is converted to static pages what is the only needed part from dynamic site to be fully functionally?

For example, I am having a website with few pages (that's why GScms is more suitable for me) and this content isn't change at all. Probably once a year I could change/add some content.
I would like to make the changes in dynamical mode then generate static pages and hide the dynamic website. This will offer more security and much more speed.
Reply
#40
(2012-10-31, 06:03:05)cmscss Wrote: I love static pages too.
I have a question. If the website is converted to static pages what is the only needed part from dynamic site to be fully functionally?

For example, I am having a website with few pages (that's why GScms is more suitable for me) and this content isn't change at all. Probably once a year I could change/add some content.
I would like to make the changes in dynamical mode then generate static pages and hide the dynamic website. This will offer more security and much more speed.

This is an old topic. Plugin maintainer isn't active anymore (for what I know). Maybe this plugin is related: http://get-simple.info/extend/plugin/htm...ation/424/
Topic: http://get-simple.info/forums/showthread...Navigation

I never tested these 2 plugins, so I hope someone else is able to help you out.
Reply
#41
GetSimple CMS is already fast and light. As far as increased performance and better security, CloudFlare can take care of that for free, and it requires no code modification.
Reply
#42
@cmscss

Maybe it's not exactly what you're looking for, but the SimpleCache plugin may suit you.
Reply
#43
I think we need a new cache plugin.
Hmmm
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#44
Doesn't work with 3.1.x? Sorry I haven't tested it since GS 2.x

[edit] Tested, it works with 3.1.2
Reply




Users browsing this thread: 1 Guest(s)