to generate static html page?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

to generate static html page?

surfman-2
I am looking for the solution using grails to generate static html pages to speed up my website visit. any one may help me out or point where I may find such a solution or plug in? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: to generate static html page?

Robert Fischer
Not sure what you're actually looking for.  If you just have a few pages that can be cached as
straight HTML, check out the cache (or is it cacheable?) plugin.

If you want to use Grails to generate a static web site, build your website, run grails run-app
(locally), and then execute: "wget -m -k http://localhost:8080/yourapp" (assuming you're on a *nix
with wget)

~~ Robert.

surfman wrote:
> I am looking for the solution using grails to generate static html pages to
> speed up my website visit. any one may help me out or point where I may find
> such a solution or plug in? Thanks.

--
~~ Robert Fischer, Smokejumper IT Consulting.
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/redirect.html


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: to generate static html page?

Tom Gullo
In reply to this post by surfman-2
I've been curious about this as well.  You can always try to roll your own with hashmaps, but it would be nice if there was something out there that was more robust.

I like the sweeper feature in Rails and I think it would be great if we had something similar in Grails.


surfman wrote
I am looking for the solution using grails to generate static html pages to speed up my website visit. any one may help me out or point where I may find such a solution or plug in? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: to generate static html page?

Daniel Guryca
Yap, sweepers feature is nice piece of stuff in Rails. Would be nice to have it integrated in grails.

Daniel

On Mon, Jun 8, 2009 at 6:14 PM, Tom_G <[hidden email]> wrote:

I've been curious about this as well.  You can always try to roll your own
with hashmaps, but it would be nice if there was something out there that
was more robust.

I like the sweeper feature in Rails and I think it would be great if we had
something similar in Grails.



surfman wrote:
>
> I am looking for the solution using grails to generate static html pages
> to speed up my website visit. any one may help me out or point where I may
> find such a solution or plug in? Thanks.
>

--
View this message in context: http://www.nabble.com/to-generate-static-html-page--tp23852296p23927178.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: to generate static html page?

doyle
In reply to this post by surfman-2
So you want to generate a HTML page every so often. Would it need to be configured on a timer? Would you lazy-load a not already generated html page? How should this solution work?

surfman wrote
I am looking for the solution using grails to generate static html pages to speed up my website visit. any one may help me out or point where I may find such a solution or plug in? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: to generate static html page?

surfman-2
Hi, It is a kind of CMS. What I want to do is

1) my designer could design template for news
2) my editor could enter data, like everyday news.
3) the script will generate a static page when the page is requested to been viewed by my user for THE FIRST TIME. after the page generated, it will be a normal static page stay on the server and will be viewed at any time by any visitor.
4) when the data is changed, same thing re-applies from step 2 - 3. my script need to compare the data updated time and the existing static page generated time. if the latter is earlier than the former, it need generate the static page again.

The way could be a efficient and light for my system.

The key thing I want to know is how grails generate a static page, like html page based on provided template. Thanks.



doyle wrote
So you want to generate a HTML page every so often. Would it need to be configured on a timer? Would you lazy-load a not already generated html page? How should this solution work?
Reply | Threaded
Open this post in threaded view
|

Re: to generate static html page?

tomas lin
You can use the GORM hibernate events afterSave and afterUpdate in
your domain objects to simply write out the file. It doesn't really
make sense to do this at request time because you're dealing with all
sorts of cache issues.

just add a bit of Groovy to generate the page - I usually just self-scrape:
http://groovy.codehaus.org/Simple+file+download+from+URL

something like

def afterSave = { saveFile() }
def afterUpdate = { saveFile() }

def saveFile(){
  def file = new FileOutputStream( 'apacheLocation/' + name + '.html' )
  out << new URL( 'http://localhost:8080/myapp/page/show/'+id ).openStream()
  out.close()
}

On Tue, Jun 9, 2009 at 3:42 AM, surfman<[hidden email]> wrote:

>
> Hi, It is a kind of CMS. What I want to do is
>
> 1) my designer could design template for news
> 2) my editor could enter data, like everyday news.
> 3) the script will generate a static page when the page is requested to been
> viewed by my user for THE FIRST TIME. after the page generated, it will be a
> normal static page stay on the server and will be viewed at any time by any
> visitor.
> 4) when the data is changed, same thing re-applies from step 2 - 3. my
> script need to compare the data updated time and the existing static page
> generated time. if the latter is earlier than the former, it need generate
> the static page again.
>
> The way could be a efficient and light for my system.
>
> The key thing I want to know is how grails generate a static page, like html
> page based on provided template. Thanks.
>
>
>
>
> doyle wrote:
>>
>> So you want to generate a HTML page every so often. Would it need to be
>> configured on a timer? Would you lazy-load a not already generated html
>> page? How should this solution work?
>>
>
> --
> View this message in context: http://www.nabble.com/to-generate-static-html-page--tp23852296p23935511.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: to generate static html page?

tomas lin
I just remembered that if you don't want to call an url, you could use
Peter Delahunty's template engine plugin to output your code into a
string.

http://www.grails.org/plugin/grails-template-engine

2009/6/9 Tomas Lin <[hidden email]>:

> You can use the GORM hibernate events afterSave and afterUpdate in
> your domain objects to simply write out the file. It doesn't really
> make sense to do this at request time because you're dealing with all
> sorts of cache issues.
>
> just add a bit of Groovy to generate the page - I usually just self-scrape:
> http://groovy.codehaus.org/Simple+file+download+from+URL
>
> something like
>
> def afterSave = { saveFile() }
> def afterUpdate = { saveFile() }
>
> def saveFile(){
>  def file = new FileOutputStream( 'apacheLocation/' + name + '.html' )
>  out << new URL( 'http://localhost:8080/myapp/page/show/'+id ).openStream()
>  out.close()
> }
>
> On Tue, Jun 9, 2009 at 3:42 AM, surfman<[hidden email]> wrote:
>>
>> Hi, It is a kind of CMS. What I want to do is
>>
>> 1) my designer could design template for news
>> 2) my editor could enter data, like everyday news.
>> 3) the script will generate a static page when the page is requested to been
>> viewed by my user for THE FIRST TIME. after the page generated, it will be a
>> normal static page stay on the server and will be viewed at any time by any
>> visitor.
>> 4) when the data is changed, same thing re-applies from step 2 - 3. my
>> script need to compare the data updated time and the existing static page
>> generated time. if the latter is earlier than the former, it need generate
>> the static page again.
>>
>> The way could be a efficient and light for my system.
>>
>> The key thing I want to know is how grails generate a static page, like html
>> page based on provided template. Thanks.
>>
>>
>>
>>
>> doyle wrote:
>>>
>>> So you want to generate a HTML page every so often. Would it need to be
>>> configured on a timer? Would you lazy-load a not already generated html
>>> page? How should this solution work?
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/to-generate-static-html-page--tp23852296p23935511.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email