You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Markus Joschko <ma...@gmail.com> on 2011/01/06 22:12:08 UTC

Delay when modifying esp script using webdav

Hi,
I decided to build a prototype using sling.
Currently I wonder about the best practice to edit the esp/jsp files.

As I don't want to create a bundle and upload it everytime I make a
small change in the scripts,
I have mapped the repository via webdav and modify the scripts directly.

But I  notice a delay of 10 seconds before the change gets picked up.
Can this be configured? Or is this a limitation of the webdav driver?
How do you edit your scripts?

BTW, I noticed that there are no caching headers used when requesting
a resource. Is this configurable?
Or does sling not utilize caching headers?

Thanks,
 Markus

Re: Delay when modifying esp script using webdav

Posted by Markus Joschko <ma...@gmail.com>.
Thanks Vidar, that works great. When mapping the filesystem I don't
have the delay issue (tested with esp) any longer.

Any other tip for the dev environment? ;-)

Regards,
 Markus

On Fri, Jan 7, 2011 at 10:08 AM, Vidar Ramdal <vi...@idium.no> wrote:
> On Thu, Jan 6, 2011 at 10:12 PM, Markus Joschko
> <ma...@gmail.com> wrote:
>> Hi,
>> I decided to build a prototype using sling.
>> Currently I wonder about the best practice to edit the esp/jsp files.
>>
>> As I don't want to create a bundle and upload it everytime I make a
>> small change in the scripts,
>> I have mapped the repository via webdav and modify the scripts directly.
>>
>> But I  notice a delay of 10 seconds before the change gets picked up.
>> Can this be configured? Or is this a limitation of the webdav driver?
>> How do you edit your scripts?
>
> I usually map the scripts folder as a FsResource. Install the
> org.apache.sling.fsresource bundle, and you'll be able to map a file
> system directory directly into the Sling resource tree. Thus, you
> don't have to deal with WebDav.
>
> The FsResource mappings can also be automatically created by the Sling
> Maven plugin. I have the following in my pom.xml:
> <profiles>
>        <profile>
>            <id>dev</id>
>            <build>
>                <plugins>
>                    <plugin>
>                        <groupId>org.apache.felix</groupId>
>                        <artifactId>maven-bundle-plugin</artifactId>
>                        <extensions>true</extensions>
>                        <configuration>
>                            <instructions>
>
> <Bundle-Category>com.idium.kolibri</Bundle-Category>
>
> <Bundle-SymbolicName>kolibri-files</Bundle-SymbolicName>
>                                <Sling-Initial-Content>
>
> apps;overwrite:=true;uninstall:=true;path:=/apps,
>
> templates;overwrite:=true;uninstall:=true;path:=/templates
>                                </Sling-Initial-Content>
>                            </instructions>
>                        </configuration>
>                    </plugin>
>                    <plugin>
>                        <groupId>org.apache.sling</groupId>
>                        <artifactId>maven-sling-plugin</artifactId>
>                        <executions>
>                            <execution>
>                                <id>install-bundle</id>
>                                <goals>
>                                    <goal>validate</goal>
>                                    <goal>install</goal>
>                                </goals>
>                                <configuration>
>                                    <skip>false</skip>
>                                    <mountByFS>true</mountByFS> <!--
> This causes the paths specified as Sling-Initial-Content to be mapped
> to file system directories. Make sure you have installed
> o.a.s.fsresource first.  -->
>                                </configuration>
>                            </execution>
>                        </executions>
>                    </plugin>
>
>                </plugins>
>
>            </build>
>        </profile>
>
> </profiles>
>
> When activating this profile (mvn install -Pdev) the file system
> mappings are automatically created for me.
>
> --
> Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
> Sommerrogata 13-15, N-0255 Oslo, Norway
> + 47 22 00 84 00 / +47 22 00 84 76
> Quando omni flunkus moritatus!
>

Re: Delay when modifying esp script using webdav

Posted by Vidar Ramdal <vi...@idium.no>.
On Thu, Jan 6, 2011 at 10:12 PM, Markus Joschko
<ma...@gmail.com> wrote:
> Hi,
> I decided to build a prototype using sling.
> Currently I wonder about the best practice to edit the esp/jsp files.
>
> As I don't want to create a bundle and upload it everytime I make a
> small change in the scripts,
> I have mapped the repository via webdav and modify the scripts directly.
>
> But I  notice a delay of 10 seconds before the change gets picked up.
> Can this be configured? Or is this a limitation of the webdav driver?
> How do you edit your scripts?

I usually map the scripts folder as a FsResource. Install the
org.apache.sling.fsresource bundle, and you'll be able to map a file
system directory directly into the Sling resource tree. Thus, you
don't have to deal with WebDav.

The FsResource mappings can also be automatically created by the Sling
Maven plugin. I have the following in my pom.xml:
<profiles>
        <profile>
            <id>dev</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.felix</groupId>
                        <artifactId>maven-bundle-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <instructions>

<Bundle-Category>com.idium.kolibri</Bundle-Category>

<Bundle-SymbolicName>kolibri-files</Bundle-SymbolicName>
                                <Sling-Initial-Content>

apps;overwrite:=true;uninstall:=true;path:=/apps,

templates;overwrite:=true;uninstall:=true;path:=/templates
                                </Sling-Initial-Content>
                            </instructions>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.sling</groupId>
                        <artifactId>maven-sling-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>install-bundle</id>
                                <goals>
                                    <goal>validate</goal>
                                    <goal>install</goal>
                                </goals>
                                <configuration>
                                    <skip>false</skip>
                                    <mountByFS>true</mountByFS> <!--
This causes the paths specified as Sling-Initial-Content to be mapped
to file system directories. Make sure you have installed
o.a.s.fsresource first.  -->
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>

            </build>
        </profile>

</profiles>

When activating this profile (mvn install -Pdev) the file system
mappings are automatically created for me.

-- 
Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 22 00 84 76
Quando omni flunkus moritatus!

Re: Delay when modifying esp script using webdav

Posted by Carsten Ziegeler <cz...@apache.org>.
Justin Edelson  wrote
> On 1/6/11 4:12 PM, Markus Joschko wrote:
>> Hi,
>> I decided to build a prototype using sling.
>> Currently I wonder about the best practice to edit the esp/jsp files.
>>
>> As I don't want to create a bundle and upload it everytime I make a
>> small change in the scripts,
>> I have mapped the repository via webdav and modify the scripts directly.
>>
>> But I  notice a delay of 10 seconds before the change gets picked up.
>> Can this be configured? Or is this a limitation of the webdav driver?
> Are you sure this happens for both ESP and JSPs? Both have a
> configurable check interval, but IIRC the ESP modification checking
> defaults to every access. JSP modification checking is every few
> seconds. To configure these, use /system/console/configMgr.

Actually changes to jsps are detected by observation - there is no
modification check anymore; therefore changes are applied immediately.
I've used webdav as well and have never experienced this with jsps so far.
Esp is a different story.

Carsten
> 
>> How do you edit your scripts?
>>
>> BTW, I noticed that there are no caching headers used when requesting
>> a resource. Is this configurable?
>> Or does sling not utilize caching headers?
> Sling doesn't set Cache-Control or Expires OOTB. You could, of
> course,add these via a Filter. A contribution of these could would be
> appreciated. I think there's some discussion on the list archives for
> the times when caching has been discussed in the past.
> 
> Justin
> 
>>
>> Thanks,
>>  Markus
> 
> 


-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Delay when modifying esp script using webdav

Posted by Justin Edelson <ju...@gmail.com>.
On 1/6/11 4:12 PM, Markus Joschko wrote:
> Hi,
> I decided to build a prototype using sling.
> Currently I wonder about the best practice to edit the esp/jsp files.
> 
> As I don't want to create a bundle and upload it everytime I make a
> small change in the scripts,
> I have mapped the repository via webdav and modify the scripts directly.
> 
> But I  notice a delay of 10 seconds before the change gets picked up.
> Can this be configured? Or is this a limitation of the webdav driver?
Are you sure this happens for both ESP and JSPs? Both have a
configurable check interval, but IIRC the ESP modification checking
defaults to every access. JSP modification checking is every few
seconds. To configure these, use /system/console/configMgr.

> How do you edit your scripts?
> 
> BTW, I noticed that there are no caching headers used when requesting
> a resource. Is this configurable?
> Or does sling not utilize caching headers?
Sling doesn't set Cache-Control or Expires OOTB. You could, of
course,add these via a Filter. A contribution of these could would be
appreciated. I think there's some discussion on the list archives for
the times when caching has been discussed in the past.

Justin

> 
> Thanks,
>  Markus